Floating Point

Noun · Development

Definitions

  1. A representation of real numbers using a mantissa and exponent (like scientific notation), defined by IEEE 754. Provides wide range but limited precision -- 0.1 + 0.2 = 0.30000000000000004 in every language. Never use floats for money, coordinates that need exact comparison, or any domain where rounding errors accumulate. Use integers (cents), decimals, or rational number types instead.

    In plain English: The way computers store decimal numbers, which causes tiny rounding errors -- famously, 0.1 + 0.2 doesn't equal exactly 0.3.

    Example: "The billing bug: 0.1 + 0.2 !== 0.3 in JavaScript. Store prices as integer cents (999 = $9.99) -- floating point is for physics, not finance."

Related Terms