Home

fixed32

Fixed32 refers to a family of 32-bit fixed-point numerical formats used to represent real numbers with a fixed binary point. In fixed32, a fixed number of lower bits are allocated to the fractional part while the remaining bits store the integer part. The arrangement is commonly described as a Qm.n format, where m is the number of integer bits and n is the number of fractional bits, with m+n+1 = 32 including the sign bit. Common variants include Q16.16 and Q1.31.

In Q16.16, values range roughly from -32768 to 32767.999... with a resolution of 1/65536; in Q1.31, the

Arithmetic in fixed32 uses scaled integers. Fixed32 numbers are stored as 32-bit integers scaled by 2^n. Addition

Conversions between representations are straightforward: from integer, multiply by 2^n; to integer, round or truncate. From

Applications of fixed32 include embedded systems, digital signal processing, graphics, and performance-critical code where floating-point hardware

range
is
-1
to
just
under
1
with
a
resolution
of
1/2^31.
and
subtraction
follow
standard
integer
rules.
Multiplication
requires
a
64-bit
intermediate
value
and
then
a
shift
right
by
n
bits
to
restore
the
fixed-point
scale.
Division
similarly
uses
a
64-bit
intermediate.
Overflow
is
a
concern,
and
some
implementations
apply
saturation
or
wrap-around.
Rounding
during
conversions
helps
maintain
accuracy.
floating-point,
multiply
by
2^n
and
round
to
the
nearest
fixed32
value;
to
floating-point,
divide
by
2^n.
is
unavailable
or
undesirable.
It
offers
deterministic
arithmetic
and
predictable
performance
at
the
cost
of
limited
range
and
precision.
Variants
beyond
Q16.16
and
Q1.31
exist
and
are
chosen
to
balance
memory
usage
against
required
precision.