Posit format descriptors #
A posit format has one sign bit and a tapered payload whose regime length depends on the encoded value. The Posit Standard (2022) fixes the maximum exponent field at two bits, so a standard format is selected only by its total width.
The descriptor is static in the Lean type. It therefore supports arbitrary widths without storing the width in every runtime value.
References #
- Posit Working Group, Standard for Posit Arithmetic (2022), March 2, 2022, Sections 2--4, https://posithub.org/docs/posit_standard-2.pdf.
- John L. Gustafson, Standard Posit Arithmetic, Supercomputing Frontiers and Innovations 9(1), 2022, https://doi.org/10.14529/jsfi220102.
Number of encoded bits below the sign bit.
Instances For
Index of the sign bit in least-significant-bit numbering.
Instances For
Natural-number bit mask containing only the sign bit.
Instances For
Unsigned encoding of the exact posit value one.
Instances For
Modulus of the exact-width unsigned encoding.
Instances For
Maximum number of exponent bits available after the regime terminator.
Instances For
Binary exponent contributed by one unit of regime value.
Instances For
One regime unit contributes 2 ^ exponentBits to the decoded binary exponent.
The same standardized posit family at one additional bit of precision.
Section 4.1 of the standard defines an n-bit rounding boundary using an (n + 1)-bit posit, so
this descriptor transformation is part of the exact rounding definition rather than an
implementation convenience.
Instances For
Adding one encoded bit adds exactly one bit to the tapered payload.
Adding one encoded bit shifts the sign mask left by one place.
Every valid posit has at least one payload bit.
The unique sign-bit mask is nonzero.
At least the codes zero and one lie below the sign-bit boundary.
The exact-one encoding is nonzero.
The exact-one encoding lies in the positive finite half of the word space.
The sign bit is strictly below the exact-width modulus.
The complete unsigned modulus is twice the mask containing the sign bit.
Construct a Posit Standard descriptor from its total encoded width.