Messing with Floating Point
Talk
— 2024-11-28
Core C++
— Tel Aviv, Israel
Abstract
Floating point arithmetic is foundational to scientific computing, graphics, and numerical algorithms—yet most developers treat it as a black box. This talk peels back the abstraction to explore how IEEE 754 floating point actually works, why certain operations produce surprising results, and what strategies exist for writing robust numerical code in C++.
Topics Covered
- IEEE 754 representation: sign, exponent, mantissa
- Special values: infinities, NaN, denormals
- Precision loss and catastrophic cancellation
- Comparison pitfalls and ULP-based testing
- Compiler optimizations and
-ffast-mathtradeoffs - Practical techniques for stable numerical algorithms
Presented At
Core C++ 2024 — Tel Aviv, Israel