Exact semantics of posit integer conversions #
The integer sentinel has only its most significant bit set. Finite posit values first undergo exact nearest-even integer rounding; the signed range is checked on that rounded integer. Within range, decoding the output recovers the rounded integer, with error at most one half. At an exact halfway numerator/denominator remainder, that integer is even.
The sentinel characterization includes an in-range result equal to the signed minimum, whose encoding coincides with the overflow and NaR sentinel.
The integer conversion sentinel has precisely its most significant bit set.
The reserved integer word converts to NaR, independently of the posit format.
Every non-sentinel integer undergoes one rounding of its exact signed value.
NaR converts to the reserved integer word at every positive width.
A finite posit whose rounded integer fits is encoded without wraparound.
A finite posit whose rounded integer is out of range produces the sentinel.
Decoding an in-range conversion gives the exact nearest-even integer.
For a finite posit, sentinel output means either overflow after rounding or a rounded result equal to the signed minimum. The latter is an in-range integer with the same reserved bits.
A finite conversion without rounded overflow has absolute error at most one half.
At an exact half-integer, the converted integer is even, provided it is in range. The remainder condition expresses a fractional magnitude of exactly one half, for either sign.
A finite posit that denotes an in-range integer converts to that integer exactly.
An integer round trip is exact when its Section 4.1 posit rounding still denotes that integer and its input word is not the sentinel. Representability is essential here.