Home

binary32

Binary32 is the IEEE 754 standard for 32-bit floating-point numbers, commonly implemented as the single-precision format in many programming languages and hardware. It consists of 32 bits divided into a sign bit, eight exponent bits, and 23 fraction bits. The value of a normal number is (-1)^sign * (1.fraction) * 2^(exponent-127), where the exponent is stored with a bias of 127. When the exponent field is zero, the number is denormalized and has the value (-1)^sign * 0.fraction * 2^(-126). In that case there is no implicit leading 1. If the exponent field is all ones (255), the value represents infinity when the fraction is zero, or NaN (not a number) otherwise. Subnormal representations allow gradual underflow toward zero.

The largest finite value is approximately 3.4028235e38, and the smallest positive normal is about 1.17549435e-38; the

IEEE 754 rounding modes apply to binary32 operations, and results may suffer from rounding error, cancellation,

smallest
positive
subnormal
is
about
1.40129846e-45.
The
format
provides
roughly
7
decimal
digits
of
precision
and
covers
a
wide
dynamic
range,
making
it
suitable
for
graphics,
real-time
systems,
and
general
numerical
tasks.
It
uses
4
bytes
per
value
and
is
generally
faster
and
more
memory-efficient
than
double-precision
formats.
overflow,
or
underflow.
Special
care
is
needed
when
comparisons,
equality
checks,
or
operations
near
zero
occur.
Variants
include
binary16
and
binary64,
with
binary32
occupying
a
middle
ground
for
performance
and
precision.