Skip to content
Infinitesimal Dynamics home
Notebook: 0 XP

Numerical Methods / Approximation and error

Floating-Point Arithmetic and Error

Computers store finitely many numbers. Learn where rounding hurts and how to avoid catastrophic cancellation.

3 min read · 1 sections · 1 checks

Contents 2 sections
  1. §1A finite number line
  2. ?Check yourself

By the end you can

  • Describe floating-point representation and machine epsilon
  • Distinguish absolute and relative error
  • Recognise and repair catastrophic cancellation

§1A finite number line

A double-precision number stores a sign, 53 bits of significand and an exponent: about 16 decimal digits. Machine epsilon, roughly 2.2×10−162.2 \times 10^{-16}, is the gap between 1 and the next representable number. That is why 0.1+0.2≠0.30.1 + 0.2 \ne 0.3 in most languages.

Check yourself

  1. Q1
    Double precision carries roughly how many significant decimal digits?