LearnViz Math
Expert ∞ Differential Equations, Abstract Algebra & Applied Math Topic 49 of 97

Floating Point and Rounding Error

Computer arithmetic is approximate.

Key idea

Computer arithmetic is approximate.

In depth

Computers store numbers with finite binary precision, so most decimals are approximated: 0.1 + 0.2 ≠ 0.3 exactly. Errors propagate, and subtracting nearby numbers causes catastrophic cancellation. Machine epsilon is about 2.2 × 10⁻¹⁶ for doubles.

Worked example

(1 + 10⁻¹⁶) − 1 = 0 in double precision.

Real-world uses

Common mistake

Testing floating-point numbers for exact equality.

How to learn this

  1. Read the key idea and say it in your own words.
  2. Work through the worked example, then try a similar problem.
  3. Use the interactive lesson’s visual and mini-quiz to check the pattern.

Frequently asked questions

What is Floating Point and Rounding Error?

Computer arithmetic is approximate. It is a topic at the expert level in Differential Equations, Abstract Algebra & Applied Math.

Where is Floating Point and Rounding Error used in real life?

Real-world examples: Understanding why spreadsheets and calculators sometimes show tiny errors such as 0.1 + 0.2.

What should I learn before Floating Point and Rounding Error?

Make sure you are comfortable with Numerical Differentiation, the previous topic in Differential Equations, Abstract Algebra & Applied Math.

What is a common mistake with Floating Point and Rounding Error?

Testing floating-point numbers for exact equality.

How can I practise Floating Point and Rounding Error?

Open the interactive lesson, play with the visual, then answer the three-question mini-quiz. Getting two right marks the topic complete.

What comes after Floating Point and Rounding Error?

Move on to Numerical Linear Algebra next.

Related expert topics in Differential Equations, Abstract Algebra & Applied Math