5 ms·
> Can someone give an example of a time you would actually want to compare floats for equality? When they are integers. By construction, floats provide exact
by enriquto 4y ago
> Can someone give an example of a time you would actually want to compare floats for equality?
When they are integers. By construction, floats provide exact arithmetic for small ints. It makes sense to compare those for equality.
Also, when defining a ``sign'' function, you may want to treat the equality case separately, to avoid introducing biases when the input data is quantized.