IEEE 754 Floating-Point Utility

Floating-Point ULP & Next Value Calculator

Calculate the ULP and adjacent representable IEEE 754 floating-point values. Inspect the previous value, next value, upward and downward spacing, hexadecimal bit pattern, exponent and significand information for Float32 and Float64.

✓ Float32 ✓ Float64 ✓ ULP ✓ Next Value ✓ Previous Value ✓ IEEE 754 Bits
ULP
Floating-Point Value
● Ready
Decimal and scientific notation are accepted, including values such as 1, 0.1, 1000000 and 1e-20.
Binary32 uses 24 bits of significand precision; Binary64 uses 53.
ULP meaning: ULP stands for unit in the last place. For a finite positive normal value, the next representable value is separated by the spacing determined by its exponent and floating-point precision. Spacing can be asymmetric at powers of two, so this calculator reports both the next-higher and previous-lower spacing.
Floating-Point ULP Result Calculated
Next Representable Value
Stored Value
Previous Value
Next Value
ULP / Upward Spacing
Downward Spacing
IEEE Hex
Unbiased Exponent
Classification
IEEE 754 Bit Layout
Sign Exponent Fraction
Calculation Breakdown

What Is a Floating-Point ULP?

ULP means unit in the last place. It describes the spacing associated with the least-significant representable bit of a floating-point number at a particular magnitude.

IEEE 754 floating-point numbers are not distributed uniformly across the real number line. Values close to zero have very fine spacing, while values with larger exponents have progressively larger gaps between adjacent representable numbers.

IEEE 754 Float32 and Float64 Precision

Format Total Bits Exponent Bits Fraction Bits Precision
Float32 / Binary32 32 8 23 24 significant binary bits
Float64 / Binary64 64 11 52 53 significant binary bits

The extra precision bit comes from the implicit leading bit used for normal binary floating-point values.

ULP Formula for Normal Floating-Point Numbers

For a positive normal binary floating-point value in a binade with unbiased exponent e, the spacing to the next larger value is:

ULP = 2^(e - fractionBits) Binary32: ULP = 2^(e - 23) Binary64: ULP = 2^(e - 52)

This gives the spacing between adjacent values within the same exponent interval.

Float64 ULP at 1.0

For IEEE 754 Binary64, the value 1.0 has unbiased exponent zero and 52 stored fraction bits.

ULP(1.0) = 2^(0 - 52) = 2^-52 = 2.220446049250313e-16

Therefore the next Binary64 value above 1 is:

1.0000000000000002

Float32 ULP at 1.0

Binary32 fraction bits = 23 Exponent of 1.0 = 0 ULP = 2^(0 - 23) = 2^-23 = 1.1920928955078125e-7

The next Float32 value greater than 1.0 is approximately:

1.0000001192092896

Why Is the Previous Spacing Sometimes Different?

Floating-point spacing changes when an exponent boundary is crossed. The value 1.0 is an important example. The spacing immediately above 1.0 in Binary64 is 2-52, but the gap between 1.0 and the immediately previous representable value is 2-53.

Previous Float64 below 1: 0.9999999999999999 Gap below: 2^-53 Next Float64 above 1: 1.0000000000000002 Gap above: 2^-52

For that reason this calculator does not assume that the upward and downward distances are always identical.

What Is the Next Representable Floating-Point Value?

The next representable value is the closest floating-point number in the selected format that is numerically greater than the current stored value. There is no representable value from the same format between the two.

This concept is useful for numerical analysis, boundary testing, floating-point comparison research, serialization testing and understanding precision loss.

Previous Representable Value

The previous value is the nearest representable floating-point number that is numerically smaller than the current value.

Current: 1.0 Float64 Previous: 0.9999999999999999 Float64 Next: 1.0000000000000002

Float32 Precision Around 16,777,216

Binary32 has 24 bits of significand precision. The integer 16,777,216 equals 224, and at this magnitude the spacing between Float32 values becomes 2.

Current Float32: 16777216 Next Float32: 16777218 Upward spacing: 2

This explains why not every consecutive integer can be represented by Float32 once values become sufficiently large.

Subnormal Floating-Point Values

Subnormal numbers fill the gap between zero and the smallest normal floating-point magnitude. Unlike normal values, they do not use an implicit leading one in the significand.

Within the subnormal range, adjacent positive values have constant spacing. For Binary32 that spacing is 2-149; for Binary64 it is 2-1074.

Smallest positive Float32: 2^-149 Smallest positive Float64: 2^-1074

ULP Around Zero

The next positive representable value after positive zero is the smallest positive subnormal value. Similarly, the next numerical value below zero is the smallest negative subnormal.

Float32: next above 0 = 2^-149 Float64: next above 0 = 2^-1074

IEEE 754 Bit Pattern

The calculator also exposes the underlying floating-point representation. A Binary32 value consists of one sign bit, eight exponent bits and 23 fraction bits. Binary64 uses one sign bit, 11 exponent bits and 52 fraction bits.

Binary32: S EEEEEEEE FFFFFFFFFFFFFFFFFFFFFFF Binary64: S EEEEEEEEEEE FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Special Floating-Point Values

IEEE 754 reserves exponent patterns for special values including positive infinity, negative infinity and NaN. These values do not behave like ordinary finite numbers when calculating adjacent values or conventional ULP spacing.

The calculator identifies normal, subnormal, zero, infinity and NaN classifications rather than applying a normal-value ULP formula where it does not belong.

Why Floating-Point ULP Matters

ULP analysis helps show the actual resolution available at a given numerical magnitude. This can be useful when investigating rounding behavior, equality comparisons, iterative numerical algorithms, sensor calculations, simulation results and binary serialization.

A fixed decimal tolerance does not represent the same number of floating-point steps at every magnitude. ULP-based analysis instead relates the error to the spacing of the selected floating-point representation.

Floating-Point ULP Calculator FAQs

What does ULP mean?
ULP means unit in the last place. It is commonly used to describe floating-point spacing or error relative to the least-significant representable position.
What is the ULP of Float64 1.0?
The spacing from 1.0 to the next larger Binary64 value is 2^-52, approximately 2.220446049250313 × 10^-16.
What is the next Float64 value after 1?
The next representable Binary64 value greater than 1 is 1.0000000000000002.
What is the next Float32 value after 1?
The next Binary32 value greater than 1 is approximately 1.0000001192092896.
Are previous and next spacing always equal?
No. At exponent boundaries such as exact powers of two, spacing immediately below a value can differ from spacing immediately above it.
What is a subnormal number?
A subnormal is a very small nonzero floating-point value represented with an exponent field of zero and without the normal implicit leading significand bit.
What is the smallest positive Float32 value?
The smallest positive nonzero Binary32 value is 2^-149, approximately 1.401298464324817 × 10^-45.
What is the smallest positive Float64 value?
The smallest positive nonzero Binary64 value is 2^-1074, approximately 5 × 10^-324 when displayed as a JavaScript Number.
Why can Float32 not represent every large integer?
As magnitude increases, the gap between adjacent Float32 values increases. Beginning at 2^24, the spacing is already 2, so consecutive integers are no longer all representable.
Does ULP remain constant?
No. For normal floating-point numbers, spacing generally increases as the binary exponent increases.
Does this calculator support negative values?
Yes. It calculates the numerically previous and next representable values for negative finite values as well.
Does the calculator support Float32 and Float64?
Yes. Binary32 and Binary64 are calculated separately using their actual IEEE 754 bit representations.

Inspect Floating-Point Precision

Calculate adjacent IEEE 754 values, ULP spacing, bit patterns, exponent fields and floating-point classification for Binary32 and Binary64 numbers.

Scroll to Top