3 ms·
Who said anything about memory representations? The language spec (or at least a summary of it) is linked in the article, and it is pretty loose: nearest highe
by eMSF 7y ago
Who said anything about memory representations?
The language spec (or at least a summary of it) is linked in the article, and it is pretty loose: nearest higher or nearest lower, chosen by the implementation (regardless of which is nearer).
IEEE double-precision float cannot store LONG_MAX (which is 2^63-1 with 8-byte longs) precisely, so it gets converted to 2^63; which you cannot cast back to a long, because it doesn't fit (resulting in undefined behaviour).