/floʊt/

noun — “a number that refuses to sit still, always sliding between precision and approximation depending on context.”

Float (short for floating-point number) is a numerical representation used in computing to approximate real numbers using a finite amount of memory. Unlike integer types, which represent whole numbers exactly, a float is designed to handle fractions, extremely large values, and extremely small values by storing numbers in a scientific-notation-like format.

At a structural level, a floating-point number is typically composed of three parts:

// conceptual layout of a floating-point number

sign × significand × base^exponent

This means a number is broken into:

  • Sign bit — determines whether the number is positive or negative
  • Significand (mantissa) — the significant digits of the number
  • Exponent — scales the value by a power of a base (commonly 2 in modern systems)

Most modern systems follow the IEEE 754 standard, which defines how floating-point numbers are stored and interpreted in binary. This is where floats become deeply tied to binary representation rather than decimal intuition, even though they often appear in decimal form when printed.

A simplified example:

// decimal concept vs float storage

value: 13.25

binary form:
1101.01

normalized float:
1.10101 × 2^3

This structure allows computers to represent both very large and very small values efficiently. However, the trade-off is precision. Because the mantissa has a fixed number of bits, many decimal fractions cannot be represented exactly in binary form.

This is why seemingly simple arithmetic can produce unexpected results:

// floating-point precision artifact

0.1 + 0.2 = 0.30000000000000004

The issue is not a bug in the arithmetic itself, but a mismatch between decimal representation and binary storage. Some decimal values repeat infinitely in binary, requiring truncation and rounding.

This leads to a central concept in floating-point systems: precision is finite, but range is vast. Floats are optimized for scale rather than exactness.

In practice, floating-point systems also define special values:

  • Infinity — representing overflow beyond representable range
  • -Infinity — negative overflow
  • NaN (Not a Number) — undefined or invalid operations, such as 0/0

These special states allow computations to continue safely even when encountering invalid or extreme results, which is critical in scientific computing, graphics, and simulations.

There are also different float sizes, typically:

// common IEEE 754 formats

32-bit float  (single precision)
64-bit float  (double precision)

The 32-bit version offers lower precision but faster computation and smaller memory usage. The 64-bit version increases precision at the cost of memory. This trade-off is fundamental in systems design and appears in nearly every programming environment.

Floating-point arithmetic is especially important in fields that deal with continuous values:

  • Physics simulations
  • 3D graphics rendering
  • Machine learning models
  • Scientific computation

In contrast, financial systems often avoid floats entirely, preferring fixed-point or decimal representations to avoid rounding errors that can accumulate over many operations.

Conceptually, float is a compromise between reality and computability. Real numbers are infinite and dense; computers are finite and discrete. Floating-point representation sits in the middle, approximating continuity with carefully structured bits.

This is also why floats sometimes feel “unstable” when inspected directly. They are not designed to preserve human-readable decimal exactness, but to preserve mathematical behavior across a wide dynamic range.

// comparison: integer vs float behavior

integer:
2 + 2 = 4   // exact

float:
0.1 + 0.2 ≠ 0.3 exactly

Despite their quirks, floats are one of the most important abstractions in computing. Without them, modern graphics, physics engines, and scientific models would either be impossibly slow or impossibly large.

Ultimately, float is not about exactness—it is about scale. It allows machines to navigate a world of approximations without collapsing under the weight of infinite precision. It is a controlled form of numerical drift, carefully standardized so that the drift behaves predictably.

See integer, decimal, binary, precision, rounding error