挥发物是否多余?

This is a sample function(C++) of alglib library used for equal chechecking:

ae_bool ae_fp_eq(double v1, double v2) {
    /* IEEE-strict floating point comparison */
    volatile double x = v1;
    volatile double y = v2;
    return x==y;
}

What is the reason for using volatile in this code?

如果删除它怎么了?

评论