Floating-Point Precision, Rounding, and Exceptions
Understand IEEE 754 representation, rounding modes, and how the FPU and SSE units signal exceptions like overflow, underflow, and invalid operations.
IEEE 754 Format
x86 floating-point follows the IEEE 754 standard. A number is stored as sign, exponent, and mantissa:
- Single (32-bit): 1 + 8 + 23
- Double (64-bit): 1 + 11 + 52
- Extended (80-bit): used internally by the x87 FPU
Why Precision Matters
Most decimal fractions cannot be represented exactly in binary. For example 0.1 + 0.2 does not equal exactly 0.3. Accumulated rounding error is a core hazard in numerical code.
All lessons in this course
- x87 FPU Programming Basics
- SSE/AVX Instruction Sets Introduction
- Vectorizing Code with SIMD
- Floating-Point Precision, Rounding, and Exceptions