• Mariya Markova's avatar
    Replace float zero comparison to FP_ZERO comparison (#10675) · c2d8d4e6
    Mariya Markova authored
    I suggest to use "[fpclassify](https://en.cppreference.com/w/cpp/numeric/math/fpclassify)" for float
    comparison with zero, because of expression "value == 0" with value very close to zero can be
    considered as true with some performance compiler optimizations.
    
    Note: this code was introduced by 9d520a7f to accept zset scores that get ERANGE in conversion
    due to precision loss near 0.
    But with Intel compilers, ICC and ICX, where optimizations for 0 check are more aggressive, "==0" is
    true for mentioned functions, however should not be. Behavior is seen starting from O2.
    This leads to a failure in the ZSCAN test in scan.tcl
    c2d8d4e6
util.c 33.1 KB