4 ms·
IMO hex should be the default representation of binary fp. Printing hex gives the exact value, without giving the illusion of having precision in the hundreds o
by firethief 7y ago
IMO hex should be the default representation of binary fp. Printing hex gives the exact value, without giving the illusion of having precision in the hundreds of digits, and can be done way faster than conversion to decimal.
>>> 0.1.hex()
0x1.999999999999ap-4
>>> 1e-100.hex()
0x1.bff2ee48e0530p-333