Floating-point is the right tool for physics simulations and the wrong tool for money. IEEE 754 doubles can represent most quantities you care about with enough precision — but they can't represent 0.1 exactly, and small errors compound.

The classic shapes: equality comparison (if (x == 0.1)), accumulation drift in long-running averages, and currency math where the difference between $1.00 and $0.999999... matters legally. The fix is to use a decimal type for money (Java's BigDecimal, Python's decimal.Decimal, Postgres's numeric), an epsilon comparison for floats (abs(a - b) < eps), and Kahan summation for accumulators that must survive millions of adds.

Less obvious shapes: NaN-poisoning (one NaN in a calculation makes the entire result NaN), infinity propagation, and subtle differences between languages on the same hardware (JS rounding modes vs Java vs C — the same expression can give different bits).

Review heuristic

Money in a float or double is a bug. Equality on a float is a bug. Accumulation in a long-running average without a corrective term is a slow-burning bug. Each one needs a deliberate justification or a type change.

External reference

CWE-682: Incorrect Calculation — the canonical industry classification for this bug class. Useful when filing tickets, writing security policies, or arguing with a static analyzer.