3 ms·
> you cannot guarantee the conversion of any integer to and from float is the same number. Totally false. Any integer between -(2^53) and 2^53 can be converte
by mark-r 7y ago
> you cannot guarantee the conversion of any integer to and from float is the same number.
Totally false. Any integer between -(2^53) and 2^53 can be converted to IEEE 64-bit double without any loss of information.
- coldtea 7y agoRead the parent again. Those are a specific integer range, not "any integer".
- mark-r 7y agoI'm just saying that the claim made by the parent is overly strong. For most of the integers that we will deal with, they can be converted back and forth to doubles without problems. Even when they can't the double will contain an integer value, it just won't be the correct value. The usual problems people have with doubles are the bits to the right of the decimal point.