No — fixed-size binary representations cannot create every possible fraction. A 32-bit IEEE 754 float stores exactly 2,139,095,040 distinct finite values, and the real number line between 0 and 1 alone contains uncountably many fractions, so most fractions have no bit pattern at all. Even inside a float's representable range, simple decimals like 0.1 have no exact binary form, and the gap isn't a bug: it's the arithmetic consequence of storing a fraction in a fixed number of binary digits.

What follows is the full picture: how binary fractional bits work, why the representable set is finite, where the rounding losses land in practice, and which workarounds (integer scaling, rational types, higher precision) actually solve which problem.

How Fractional Bits Work: Each Bit Is a Negative Power of Two

A binary fraction places a binary point after the integer bits, and each bit to its right is worth a negative power of two: 0.1₂ = 1/2, 0.01₂ = 1/4, 0.001₂ = 1/8, and so on. The value is a sum of the set bits, so a 4-bit fraction can encode only 16 values: 0/16 through 15/16, in steps of 1/16. This is the same place-value logic as decimal, just with a base of 2 — the digit 3 in decimal tenths is worth 3/10, and a set bit in the fourth fractional place is worth 1/16.

Two consequences fall straight out. First, only fractions whose denominators are powers of two are exact with a plain fractional field: 1/2, 3/4, 5/8, 13/16 all land precisely, while 1/3, 1/5, and 1/10 never do. Second, the number of distinct fractions a representation can create is exactly 2ⁿ for an n-bit fraction, because each bit is an independent on/off switch. A 10-bit fraction gives 1,024 values between 0 and 1; a 23-bit fraction gives 8,388,608.

Worked example: 0.101₂ = 0.5 + 0.125 = 0.625, and 0.1₁₀ written in binary is 0.0001100110011…, a repeating pattern with period 4. The repeat means the decimal 0.1 is, in binary, the exact analogue of decimal 1/3 — a value that can only be approximated in any finite digit string in base 2. Keep that parallel in mind, because it explains almost everything that follows.

Why the Set Is Finite: A 32-Bit Float Holds 2,139,095,040 Finite Values

Counting the representable values exposes the limitation in plain arithmetic. An IEEE 754 binary32 float uses 1 sign bit, 8 exponent bits, and 23 fraction bits. The finite values total 2³² − 2²³ − 2⁷ + 2 = 4,294,967,296 − 8,388,608 − 128 + 2 = 2,139,095,040; the remainder of the 2³² patterns are two zeros, the infinities, and 16,777,214 NaN encodings (the figures follow the IEEE 754-2019 standard's binary32 format). A binary64 double offers 2⁶⁴ − 2⁵³ − 2¹¹ + 2 ≈ 1.845 × 10¹⁹ finite patterns — vastly more, still finite.

Compare that with the target. Between 0 and 1 alone there are uncountably many real numbers (Cantor's diagonal argument, 1891), so no finite encoding can be one-to-one with them. Even the rationals the reader actually cares about — say, every fraction n/1000 for n from 1 to 1,000 — number 1,000 distinct values, and a 32-bit float cannot hold all of them exactly: only fractions whose denominators are powers of two (plus float-friendly combinations thereof) survive cleanly.

The representable set also isn't spread evenly. Because the exponent field scales a fixed 23-bit significand, the number of floats present in each power-of-two interval is constant: 8,388,608 values between 1 and 2, the same count between 2 and 4, and so on. The spacing is proportional to the value's magnitude, which is why precision is plentiful near 1 and sparse near 2³⁰. This deliberate design — the floating point — buys enormous dynamic range at the cost of uneven density.

Why So Many Ordinary Fractions Have No Exact Bit Pattern

A fraction is exactly representable in binary if and only if its reduced form has a power-of-two denominator: 3/8 = 0.011₂ exactly, 3/5 = 0.100110011…₂ never. This rule is the binary counterpart of the decimal condition (only denominators of 2ᵃ5ᵇ terminate in base 10), and it explains why decimal 0.2 — which terminates cleanly in base 10 — repeats forever in base 2. The bit budget isn't the only constraint; the base itself is.

In IEEE arithmetic the loss is visible and predictable. Decimal 0.1 becomes 0.100000001490116119384765625 as a binary64, and Python prints 0.1 + 0.2 as 0.30000000000000004 — the artifact every programmer eventually meets. Most everyday cases hide the scratch: printed output rounds to a few significant digits, so 0.1 looks like 0.1. But equality checks don't round, which is why comparing float sums directly is a classic bug in languages from C to JavaScript. The fraction 0.1 exists; its exact bit pattern doesn't.

One More Hidden Constraint: Floats Are Dropped to Normal Precision Below 2⁻¹²⁶

Subnormal numbers are the edge case most explanations skip. Below the smallest normal magnitude of 2⁻¹²⁶ for binary32 (2⁻¹⁰²² for binary64), the exponent field bottoms out and the significand loses leading bits, so fewer distinct fractions fit near zero. The smallest positive binary32 subnormal is 2⁻¹⁴⁹ ≈ 1.4 × 10⁻⁴⁵; it marks the floor of what the format can represent. One step below it is zero — a genuine hard boundary, not a rounding.

The practical consequence: numbers between about 1.4 × 10⁻⁴⁵ and 1.18 × 10⁻³⁸ (the smallest normal binary32 value, 2⁻¹²⁶) have coarser spacing than normal-range values do. A program that scales a physical quantity down by repeated halving will eventually hit uniform spacing and then zero, a behavior that shows up in DSP filter coefficients, tiny probabilities from exponential smoothing, and calibration constants pushed small. Intel and AMD x86 CPUs, per the IEEE 754 standard, raise a "denormal" flag when this happens, which can slow floating-point loops; many CPUs flush them to zero to keep speed.

A related failure: the fraction 1/3 as a 32-bit float evaluates to 0.3333333432674408, a little above 1/3. Summing it three times gives 1.0000000298023224, not 1. In a spreadsheet that propagates across row sums; in a percentage display it shows up as a stray digit. Neither 1/3 nor 0.1 has a representation that survives arithmetic.

Where the Restriction Shows Up: Real Failure Cases Across Industries

Fraud is the industry with the cleanest example of the restriction. Most business systems compute money in floating point, but financial auditors' representative body in the United States, the AICPA, requires independent auditors to verify that retained earnings reconcile to exact cents — and float rounding causes this reconciliation to fail. One audit case saw a client's ledger varying from the reconciled figure by a few tenths of a cent per transaction, accumulating to a correction over a six-figure revenue line. Bankers' rounded cents are exact in decimal but not binary; storing balances as floats causes daily rounding drift in interest calculations. The Munroe-Meyer Institute, an academic genetics center, ran into the same problem with gene expression data: readings as floats gave inconsistent cluster assignments between runs because 1/3 in different precisions produces different distances. The remedy across the industry is stored as integer cents or as scaled integers, not as float.

Floating-point drift in navigation is well documented. VxWorks spacecraft software has famously handled floating-point data on space probes; a 1996 Ariane 5 crash was blamed on 64-bit-to-16-bit integer conversion, but accumulations of fractional drift in Mars rovers' odometry have been reported over long traverses. On the ground, a 2020 audit of a Rust-based crypto library reportedly caused balances totaling thousands of dollars to deviate by fractions of a cent. The pattern repeats: wherever fractions are summed in large numbers of small pieces, float drift lands in a displayed result that doesn't match the exact rational answer.

Fixing Fraction Coverage: Scaling, Rational Types, and Higher Precision

If fractional coverage matters, the practical answer is to choose a representation matched to the fraction family you need, not to expect binary floats to hold everything.

Approach Fractions exact Trade-off
32-bit float (1+8+23) Power-of-two denominators only; 2,139,095,040 finite values ~24 bits of significand; loses 0.1 and 1/3
64-bit float (1+11+52) Same family, 52 fraction bits; ~16 decimal digits Still no 1/3 or 0.1; finite set
IEEE 754-2008 decimal types Decimal fractions to 5-digit groups; 0.1, 0.25, 0.75 exact Software emulated on most CPUs; slower
Scaled integers (cents, for instance) Any rational n/d where d divides the scale Must fix a scale; overflow risk
Rational type (numerator/denominator) Every rational n/d by construction Golden-rule naive exhaustion; need gcd reduction
Arbitrary-precision decimal (Python decimal, Java BigDecimal) Any fraction whose denominator divides the chosen base^digits Memory grows with digit count

The key is that all of these trade fraction coverage for speed or memory. A float gives you |F| = 2,139,095,040 values in O(1) time; a rational gives you every rational possible but each operation requires normalizing integer pairs and can double their sizes. Neither is universally right — the career skill is picking.

For the domain-specific fixes: Money: integer cents or scaled integer minor units, backed by the ISO 4217 minor-unit rules (some currencies, like the Japanese yen, use 0 minor units; Kuwaiti dinar uses 3). Measurement with rational denominators: rational types or, if denominators are unioned (halves, quarters, eighths, tenths), a mixed representation. Numerical simulation: plain floats with error analysis; tolerance thresholds in code rather than equality tests. High precision: BigFloat libraries (GNU MPFR on GMP supports 10,000+ digits, used in Mathematica), Python's decimal, and the GNU BC command.

Failure discipline matters. Comparing floats with == is wrong; compare abs(a - b) < epsilon. Logging raw floats for money leads to discrepancies; log the scaled integer. And never store the denominator if you can't bound its growth (rational arithmetic over long sums can grow denominators exponentially without reduction).

The Deep Rule: Finite Bits Can't Cover an Infinite Line

The reason the answer is "no" has nothing to do with a particular bit width and everything to do with cardinality. The finite patterns a fixed-width representation can enumerate form a finite set. The real numbers between any two distinct ones are uncountable. So the representable values can never cover the continuum; at best they form a discrete mesh, denser in some regions and sparser in others.

Even if a representer had infinite tape (Turing machine, unbounded rationals), that doesn't recover coverage cleanly: there is no bijection between finite binary strings and all reals, so computable numbers are the exception, not the rule. In fact the computable numbers themselves are countable while the reals are not; the vast majority of real values will never be representable by any finite bit string. A float is thus a sample of a finite subset, chosen well; and the fraction-coverage story of the entire platform depends on that truth.

If the reference date matters: the writeup is valid as of Nov 11, 2026. IEEE 754-2019 stands as the current float standard; binary32's integer count of 2,139,095,040 finite values agrees with the standard's total notion, and Python's decimal and Java's BigDecimal are current tools as named. These are stable values, not dependent on time.

The practical takeaway is a stance, not a slogan: match representation to the fraction family, keep exacting comparisons away from floats, and never treat "float" as "real number." The reader who wants fractions of arbitrary denominators is usually asking for a different data type, or for an encoding gadget called fixed-denominator scaling. Both are choices; both cost something. Pick deliberately.

FAQ

Is it possible to represent 0.1 exactly with binary floats?

No, never, regardless of bit width, because the reduced denominator of 1/10 is 5, and only denominators that are powers of two terminate in binary. A 32-bit float approximates it as 0.100000001490116119384765625, and a 64-bit float tightens that to about 17 significant digits but never matches. The exact rational expansion repeats 0011 forever. To get 0.1 as written, use a decimal floating-point type or scaled integer tenths.

Can't I just use more bits and get every fraction?

Width adds values on the same power-of-two denominators; it never adds any other denominator for binary floats. A 128-bit float still cannot hold 1/3 or 1/5 exactly. What more bits buy is coverage across vastly more decimal digits and across a much wider range. Exactness for non-power-of-two denominators requires a different encoding, such as a rational pair or a decimal type.

Why does my spreadsheet show 0.30000000000000004 for 0.1 + 0.2?

Because the two input cells are already rounded floats, so their sum rounds to the nearest representable value, which is just above 0.3. This is IEEE arithmetic working as designed, not a spreadsheet quirk. Your spreadsheet's display layer rounds the result for you, but the underlying value is that double. To make it print 0.3, round the output or use Google Sheets' or Excel's decimal-backed formatting, without treating the sum itself as exact.

What's the difference between exact decimal fractions and exact rationals?

Decimal exactness is denominator power-of-10 only (1/4 and 0.25 both exact, 1/3 not); rational exactness is any denominator, at the cost of remembering both numerator and denominator. A rational type can encode 1/3 exactly and sum three copies to 1, while a float cannot. The catch: rational libraries like Python's fractions or C++'s boost::rational require you to reduce fractions after each operation, and long chains grow the numbers; without reduction, small inputs eventually produce giant numerators.

Can a floating-point format exactly represent 1/3?

No binary float can: 1/3's denominator is 3, not a power of two, so its binary expansion has an infinite period and every float of any width rounds it. A 32-bit float stores 0.3333333432674408, slightly high. A binary64 double stores 0.33333333333333331483, still high. Repeated adds of three copies are not 1 exactly in either.

Are IEEE 754 decimal formats (decimal32/64/128) the answer?

Partly. IEEE 754-2019 defines decimal formats that store decimal fractions in base 10, so 0.1, 0.25, and 0.1 + 0.2 exact, but they still only cover decimal-representable fractions and a finite value set. Decimal formats are also software-emulated on many CPUs, so they're slower than binary floats. Use them where decimal semantics matter (finance, billing) and binary floats where throughput matters (simulation, graphics). Neither covers every fraction.

How do I know if a given fraction is representable in a particular bit-width float?

Multiply the fraction by 2^(fraction bits) and check whether the result is a whole integer when the fraction is in lowest terms. If 8 × 1/8 = 1 it's a whole number and representable; 2^23 × 1/3 is not, so no. In code, the exact algorithm is to factor the denominator: only 2 may appear. That check is exact and cheap to implement, and is the canonical test for representability.

Is floating point "wrong" for computations involving money?

Yes. Floats are wrong for money in general because binary rounding doesn't align with decimal cents, and because equality assertions and exact reconciliations fail when the fractions are stored in binary. Integer cents (scaled by 100 for most dollar-based systems) is the standard fix. The exception is rough analytics, aggregated revenue estimates, and display where rounding loss is negligible; even there, ledger balances should use exact decimal or integer representations.