Unsigned posit integer conversion guarantees #
Accepted outputs denote the nearest-even integer exactly and have at most one-half unit of error. The range test applies to this rounded integer, including small negative inputs that round to zero.
The sentinel characterization includes the in-range integer 2^(width-1);
its unsigned encoding is indistinguishable from the NaR or out-of-range result.
Input conversion reserves that word before numerical rounding. Representable
non-sentinel integers have exact round trips.
The reserved unsigned word has just its most significant bit set.
Non-sentinel unsigned inputs use their natural-number value, even when their MSB is set.
If a finite posit denotes the unsigned integer exactly, conversion recovers that posit.
A rounded integer in the full unsigned range is packed without wraparound.
The output's unsigned numerical interpretation equals the rounded integer.
Sentinel output also occurs for the valid unsigned integer sharing those bits.
A successful conversion has the nearest-integer error bound.
Half-integer ties choose an even output, by the shared exact integer rounder.
An unsigned integer that is exactly represented by the posit is returned unchanged.
Exact posit representability and a non-sentinel input suffice for an unsigned round trip.