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