x
and y
are set to PI
, the expression x - y
might not return zero, and the expression 1 / (x - y)
might return some huge-magnitude number instead of returning NaN
or throwing some exception. Furthermore, as the number of floating-point calculations on an input value increases, so does the margin of error in the result.However, if at most a very small number of such calculations are executed, and the margin of error does not go beyond a certain range as a result or through other guarantees, then we can use that range to check if an expression returns an output value that needs special handling. The classes in this module provide this checking ability.
Classes | |
class | sgdk::ZeroChecker<> |
Checks if an input value can accurately be treated as zero. More... |