In python, given the numbers 2.056e+07
and 2.05645e+07
, how do you find each number's significant digits? That is, the length of the mantissa. The purpose is to compare numbers for data entry and only choose the one with the most information.
This information is somehow hidden in Why Are Floating Point Numbers Inaccurate? (and maybe Easy way of finding decimal places).
Using '2.05645e+07'.index('e')
seems like such a hack.