Scientific notation in Python - extra digits

30 views Asked by At

I have the following very small floating number in Python:

fnum = 0.00012345689000007

When I try to convert to a scientific notation, I am not sure where the extra digits after 7 (the last digit) are coming from:

print("%.40e"%fnum)

This is the result: '1.2345689000007001204055334664388965393300e-04'

I would be happy if someone could explain.

0

There are 0 answers