Powers of 10 Not Working Correctly in Python: Multiplying by 10**7 Not Returning the Same as 10E7

I thought the syntax 10e7 is equivalent to 10**7.

However, I get the following odd output that I do not understand.

-8.555376292852173*(10**7)

returns

-85553762.92852174

And

-8.555376292852173*(10e7)

returns

-855537629.2852174

The output of the first is a factor 10 smaller than the output of the second. I am using Jupyter lab.

How come?

2 Answers

This is because 10**7 is indeed 10^7 but 10e7 is actually equal to 10*10^7. 1e7 is already 10^7.

0

Common mistake. You need 1e7, not 10e7. 10e7 is off by a factor of 10.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest