TExcelTAD
Home › Basic Math & Pre-Algebra › Scientific Notation

Scientific Notation

Scientific notation writes very large and very small numbers as "a number between 1 and 10, times a power of ten". It keeps the important digits up front, makes the size obvious at a glance, and is exactly the 1.5e9 style that every programming language accepts.

The form

A number in scientific notation looks like this:

m×10ewith 1≤m<10(m is the mantissa or significand, e the exponent)m \times 10^e \quad \text{with } 1 \le m < 10 \quad \text{($m$ is the mantissa or significand, $e$ the exponent)}
Ordinary Scientific Code
4,700,000 4.7×1064.7 \times 10^6 4.7e6
299,792,458 2.99792458×1082.99792458 \times 10^8 2.99792458e8
0.00052 5.2×10−45.2 \times 10^{-4} 5.2e-4
0.000000001 1×10−91 \times 10^{-9} 1e-9

The exponent counts how many places the decimal point moves. A positive exponent means a big number (move right); a negative one, a small number (move left).

Converting by moving the decimal point

Big number → scientific. Move the point left until one nonzero digit is in front of it, and count the moves:

4 700 000.→4.700000moved 6 places left→4.7×1064\,700\,000. \to 4.700000 \quad \text{moved 6 places left} \to 4.7 \times 10^6

Small number → scientific. Move the point right until it sits after the first nonzero digit:

0.00052→0005.2moved 4 places right→5.2×10−40.00052 \to 0005.2 \quad \text{moved 4 places right} \to 5.2 \times 10^{-4}

Back again. 3.06×1053.06 \times 10^5: move the point 5 places right, filling with zeros: 306,000. And 7.1×10−37.1 \times 10^{-3}: 3 places left: 0.0071.

Python's e format does the conversion for you:

python · try it yourself
for x in [4_700_000, 299_792_458, 0.00052, 0.000000001]:
    print(f"{x:>14}  ->  {x:.3e}")

print(float("3.06e5"), float("7.1e-3"))
print(2.5e3 == 2500)
       4700000  ->  4.700e+06
     299792458  ->  2.998e+08
       0.00052  ->  5.200e-04
         1e-09  ->  1.000e-09
306000.0 0.0071
True

The .3e format rounds the mantissa to 3 decimal places. Notice that Python itself switched 0.000000001 to 1e-09 when printing it plainly: floats that small or large are shown in scientific form automatically.

Calculating in scientific notation

The exponent laws make products and quotients easy: multiply (or divide) the mantissas, add (or subtract) the exponents, then fix the mantissa if it left the range 1 to 10.

(3×104)×(5×107)=15×1011=1.5×1012(8×109)÷(2×103)=4×106(6×10−3)×(4×105)=24×102=2.4×103\begin{aligned} (3 \times 10^4) \times (5 \times 10^7) &= 15 \times 10^{11} = 1.5 \times 10^{12} \\ (8 \times 10^9) \div (2 \times 10^3) &= 4 \times 10^6 \\ (6 \times 10^{-3}) \times (4 \times 10^5) &= 24 \times 10^2 = 2.4 \times 10^3 \end{aligned}

Adding needs the same exponent first, just like adding fractions needs a common denominator:

3.2×105+4.1×104=3.2×105+0.41×105=3.61×1053.2 \times 10^5 + 4.1 \times 10^4 = 3.2 \times 10^5 + 0.41 \times 10^5 = 3.61 \times 10^5
python · try it yourself
a = 3e4 * 5e7
b = 8e9 / 2e3
c = 3.2e5 + 4.1e4
print(f"{a:.2e}  {b:.2e}  {c:.3e}")

# How many seconds in a year, and how many nanoseconds?
seconds = 365 * 24 * 60 * 60
print(f"{seconds:,} s = {seconds:.3e} s = {seconds * 1e9:.3e} ns")
1.50e+12  4.00e+06  3.610e+05
31,536,000 s = 3.154e+07 s = 3.154e+16 ns

Tip: "A year is about π×107\pi \times 10^7 seconds" (3.14×1073.14 \times 10^7) is a memorable approximation that is within 0.4% of the real value.

Order of magnitude

The exponent alone tells you the order of magnitude: the rough size of a number. 4.7×1064.7 \times 10^6 and 9.1×1069.1 \times 10^6 are both "millions". Engineers compare orders of magnitude to sanity-check designs: if one approach handles 10310^3 requests per second and another 10610^6, the difference is "three orders of magnitude", a factor of 1000.

In software

  • Float literals: 1e-9, 6.02e23 and 1e6 work in Python, JavaScript, C, Rust, Java and JSON. They are always floats, so 1e6 is 1000000.0, not the integer 1000000.
  • Tolerances: numerical code compares floats with a small epsilon such as 1e-9 instead of == (see Floating Point).
  • Latency numbers: an L1 cache hit takes about 1×10−9 s1 \times 10^{-9}\ \text{s}, a disk seek about 1×10−2 s1 \times 10^{-2}\ \text{s}, a gap of seven orders of magnitude. Rough "numbers every programmer should know" tables are written in this style.
  • Machine learning: learning rates like 3e-4 and model sizes like 7e9 parameters are written the same way.

Exercises

Exercise 1: To scientific

Write in scientific notation: 52,000; 0.0009; 6,371,000; 0.0000403.

Answer

5.2×1045.2 \times 10^4, 9×10−49 \times 10^{-4}, 6.371×1066.371 \times 10^6, 4.03×10−54.03 \times 10^{-5}.

Solution
52 000.point moves 4 left→5.2×1040.0009point moves 4 right→9×10−46 371 000.point moves 6 left→6.371×1060.0000403point moves 5 right→4.03×10−5\begin{aligned} &52\,000. && \text{point moves 4 left} && \to 5.2 \times 10^4 \\ &0.0009 && \text{point moves 4 right} && \to 9 \times 10^{-4} \\ &6\,371\,000. && \text{point moves 6 left} && \to 6.371 \times 10^6 \\ &0.0000403 && \text{point moves 5 right} && \to 4.03 \times 10^{-5} \end{aligned}

Exercise 2: Back to ordinary

Write as ordinary numbers: 8.25×1038.25 \times 10^3, 1.6×10−21.6 \times 10^{-2}, 7×1007 \times 10^0.

Answer

8250, 0.016, 7.

Solution

8.25×1038.25 \times 10^3: move the point 3 right → 8250. 1.6×10−21.6 \times 10^{-2}: move it 2 left → 0.016. 100=110^0 = 1, so 7×100=77 \times 10^0 = 7.

Exercise 3: Multiply and divide

Compute (2.5×106)×(4×10−2)(2.5 \times 10^6) \times (4 \times 10^{-2}) and (9×104)÷(3×107)(9 \times 10^4) \div (3 \times 10^7) in scientific notation.

Answer

1×1051 \times 10^5 and 3×10−33 \times 10^{-3}.

Solution
2.5×4=10,106×10−2=104→10×104=1×1059÷3=3,104÷107=10−3→3×10−3\begin{aligned} &2.5 \times 4 = 10,\quad 10^6 \times 10^{-2} = 10^4 && \to 10 \times 10^4 = 1 \times 10^5 \\ &9 \div 3 = 3,\quad 10^4 \div 10^7 = 10^{-3} && \to 3 \times 10^{-3} \end{aligned}
python · try it yourself
print(f"{2.5e6 * 4e-2:.1e}  {9e4 / 3e7:.1e}")
1.0e+05  3.0e-03

Exercise 4: Data volume

A service logs 1.2×1061.2 \times 10^6 events per day, and each event is 5×1025 \times 10^2 bytes. How many bytes per day? About how many per year (365 days)?

Answer

6×1086 \times 10^8 bytes per day; about 2.19×10112.19 \times 10^{11} bytes per year.

Solution
per day:1.2×5=6,106×102=108→6×108 bytes (600 MB)per year:6×108×365=2190×108=2.19×1011 bytes (about 219 GB)\begin{aligned} \text{per day:} &\quad 1.2 \times 5 = 6,\quad 10^6 \times 10^2 = 10^8 \to 6 \times 10^8\ \text{bytes (600 MB)} \\ \text{per year:} &\quad 6 \times 10^8 \times 365 = 2190 \times 10^8 = 2.19 \times 10^{11}\ \text{bytes (about 219 GB)} \end{aligned}
python · try it yourself
day = 1.2e6 * 5e2
print(f"{day:.2e} {day * 365:.3e}")
6.00e+08 2.190e+11

Test yourself

Which is 0.00031 in scientific notation?

  1. 3.1×1043.1 \times 10^4
  2. 3.1×10−43.1 \times 10^{-4}
  3. 31×10−531 \times 10^{-5}
  4. 3.1×10−33.1 \times 10^{-3}

What type is the Python literal 1e6?

  1. int
  2. str
  3. Decimal
  4. float

What is (4×105)×(3×10−2)(4 \times 10^5) \times (3 \times 10^{-2})?

  1. 1.2×1041.2 \times 10^4
  2. 12×10−1012 \times 10^{-10}
  3. 1.2×1031.2 \times 10^3
  4. 7×1037 \times 10^3