Floating-Point Arithmetic
Subject: Computer and Technology noun /ˈfloʊ.tɪŋ ˌpɔɪnt əˈrɪθ.mə.tɪk/ 1 definition
- computer-architecture
- numerical-computing
- data-representation
- binary-arithmetic
-
Definition (noun)
Entry #137 · UpdatedFloating-Point Arithmetic is a numerical representation and computation system that encodes real numbers in a format analogous to scientific notation, separating each value into a sign, a fixed-precision significand, and an integer exponent over a fixed base (typically 2). By letting the radix point "float" across scales, it allows fixed-width binary hardware registers to handle both microscopic fractions and astronomical magnitudes within the same data type, trading uniform precision for broad dynamic range. Because finite binary representations cannot encode every rational or irrational value exactly, operations governed by standards such as IEEE 754 rely on deterministic rounding modes and define special states—including positive and negative infinity, signed zero, and Not a Number (
NaN)—to handle overflow, underflow, and undefined results predictably.Common Forms
Single-Precision (FP32): Uses 32 bits (1 sign bit, 8 exponent bits, and 23 explicit significand bits) to provide roughly seven decimal digits of precision, making it a staple for 3D graphics, audio processing, and general-purpose scientific workloads where memory bandwidth matters.
Double-Precision (FP64): Allocates 64 bits (1 sign bit, 11 exponent bits, and 52 explicit significand bits) to achieve roughly 15 to 17 significant decimal digits, serving as the standard in engineering simulations, numerical linear algebra, and default floating-point types in languages such as Python and JavaScript.
Half-Precision and Brain Float (FP16 / BF16): Compresses values into 16-bit formats to double memory density and accelerate matrix math on GPUs and AI accelerators, with
FP16favoring higher mantissa precision andBF16retaining the wide exponent range ofFP32for deep learning training.Decimal Floating-Point: Represents values in base 10 rather than base 2 (such as IEEE 754
decimal64or software decimal libraries) so base-10 fractions like0.01remain exact, preventing binary rounding errors in financial, tax, and billing systems.
Example
In an e-commerce checkout service written in JavaScript or Python, computing
0.1 + 0.2using IEEE 754 double-precision floating-point arithmetic evaluates to0.30000000000000004rather than0.3because neither0.1nor0.2has an exact finite binary representation. To prevent rounding discrepancies from accumulating across thousands of line items, developers either store monetary totals as integer cents or switch to decimal floating-point arithmetic.