3 ms·
Numeric comparison implies subtraction or similar a - b sign and zero extraction at some lower level (in an ALU micro-op perhaps), so that's duplicated effort o
by burnt-resistor 6mo ago
Numeric comparison implies subtraction or similar a - b sign and zero extraction at some lower level (in an ALU micro-op perhaps), so that's duplicated effort of a - b unless it can be optimized away.
match a - b {
d if d >= 0.0 => d < f64::EPSILON,
d => d >= -f64::EPSILON, /* true if -EPSILON to -0.0 */
}
https://godbolt.org/z/71PGzd7oa https://godbolt.org/z/71PGzd7oa