How does float guarantee 7 digit precision?
问题 As I know Single-precision floating-point number has 1 bit for sign, 8 bits for exponent and 23 bits for mantissa. I can understand that 7 digit integers fit 23 bit mantissa and don't loose precision but can't understand how a number like 1234567000000000 fits without loose "1,2,3,4,5,6,7" digits, what is the math behind this? 回答1: The IEEE-754 basic 32-bit binary floating-point format only guarantees that six significant decimal digits will survive a round-trip conversion, not seven.