wire / wire-format / ieee754-float
IEEE 754 is the standard for floating-point arithmetic. Binary32 (float): 1 sign bit, 8 exponent bits (bias 127), 23 mantissa bits (24 with implicit leading 1). Binary64 (double): 1 sign, 11 exponent (bias 1023), 52 mantissa (53 with implicit). Special values: 0 (exp=0, mant=0), subnormal (exp=0, mant!=0), infinity (exp=all 1s, mant=0), NaN (exp=all 1s, mant!=0).
aka: IEEE 754 floating-point (binary32/binary64)
spec: IEEE 754-2019
IEEE 754 is the standard for floating-point arithmetic. Binary32 (float): 1 sign bit, 8 exponent bits (bias 127), 23 mantissa bits (24 with implicit leading 1). Binary64 (double): 1 sign, 11 exponent (bias 1023), 52 mantissa (53 with implicit). Special values: 0 (exp=0, mant=0), subnormal (exp=0, mant!=0), infinity (exp=all 1s, mant=0), NaN (exp=all 1s, mant!=0).
| field | size | meaning |
|---|---|---|
| Sign | 1 bit | 0 = positive, 1 = negative. |
| Exponent (binary32) | 8 bits | Biased exponent. Bias = 127. Actual exponent = stored - 127. Range: -126 to +127 (0 and 255 reserved). |
| Exponent (binary64) | 11 bits | Biased exponent. Bias = 1023. Actual exponent = stored - 1023. Range: -1022 to +1023. |
| Mantissa (binary32) | 23 bits | Fractional part. Implicit leading 1 for normal numbers (24-bit precision). Subnormals have no implicit 1. |
| Mantissa (binary64) | 52 bits | Fractional part. Implicit leading 1 for normal numbers (53-bit precision). |
| Zero | special | Exponent=0, mantissa=0. Signed zero: +0 (0x00000000) and -0 (0x80000000). |
| Subnormal | special | Exponent=0, mantissa!=0. Value = (-1)^sign * 2^(-126) * (mantissa/2^23) for binary32. |
| Infinity | special | Exponent=all 1s, mantissa=0. Signed: +inf and -inf. |
| NaN | special | Exponent=all 1s, mantissa!=0. Quiet NaN (MSB of mantissa=1) vs Signaling NaN (MSB=0). |
example:
40 49 0f db
binary32: +3.14159265 (pi) = 0x40490FDB
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/ieee754-float
or /wire-format/ieee754-float.json