3 ms·
I once ported a small amount of code from C to a managed language. The C code used single precision floats (24 bit significand), the target language supported o
by andrewf 4y ago
I once ported a small amount of code from C to a managed language. The C code used single precision floats (24 bit significand), the target language supported only double precision (53 bit significand). There was little enough math that it was practical to do something like frob = x * 2 ** (53-24); x += frob; x -= frob; to truncate the extra bits and produce the same result, for easier verification.