Why 0.1+0.2 != 0.3, or the Mysterious World of Floating-Point Numbers
summary
Explains why decimal sums like 0.1+0.2 do not equal 0.3 due to floating-point representation and arithmetic. Covers how computers represent real numbers in binary (IEEE 754), the resulting rounding errors and pitfalls in PHP and similar languages, and practical implications for developers.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 1:251+0.2 != 0.3 problem
- 4:18Floating-point precision
- 6:24Binary representation
- 12:25Floats vs integers
- 14:13Floating limits
- 17:45Unexpected precision loss
- 18:47IEEE 754 standard
- 19:30Ariane 5 failure
- 24:08Patriot missile failure
- 30:533D calculations
- 32:38PHP floats experiment
- 33:20Database storage
- 35:05Data transmission
- 36:05Scientific use cases
- 37:49Money problems
- 39:34Solutions for money
- 40:38Alternatives to floats
- 41:42Java BigDecimal
- 42:02Conclusion
related talks
46mIntegers, Floating Points or Exotic Representations ...
44mDid You Know What You Just Counted? Automated Verification of Numerical Computations
42mfixed_point
01h 32mPlenary: Six Impossible Things
24m"It's all about money, money, money"
01h 01mKeynote: Six Impossible Things
39mOf representation and interpretation: A unified theory
34mOrders of Magnitude
