Scientific Notation for Floating Point Numbers

Another way of typing floating-point data is to use scientific notation. For instance, the number 0.0012 can also be entered as 1.2e-3. In this example, "e-3" means "10 to raised to the minus three power" and this value is multiplied by 1.2; hence, 1.2e-3 is equivalent to 0.0012. Try typing 0.0012 into the Repl.it command line, then try entering 1.2e-3. You should see that Python views both entries as the same value. Scientific notation is very useful when the exponents are very positive or very negative. In data science, exponents in numbers such as -5.63e127 or 2.134589e-63 would not be uncommon. Rather than writing out numbers of this kind in their full form, scientific notation offers a more compact, readable form for presenting float data. If you need to review scientific notation, watch this video.

Last modified: Tuesday, November 17, 2020, 4:14 PM