Bounded fixed-point conversion runtime #
Conversion into bounded fixed point takes the OverflowPolicy of its arithmetic as its context:
reject returns outOfRange, wrap reduces the rounded coefficient modulo 2 ^ width, and
saturate clamps it to the signed range. Conversion.Instances installs reject as the
context-free default.
Whether the ties-to-even rounded coefficient fits the signed destination width.
Instances For
Status for a delivered bounded fixed-point conversion.
Instances For
Quantize one finite rational according to the named bounded-overflow policy.
Instances For
Convert a rational observation, finite or not, under a bounded-overflow policy.
Instances For
The signed output coefficient after nearest-even rounding and the selected overflow policy.
The wrapping relation uses centered integer reduction, and saturation uses the signed range endpoints. Neither clause refers to a fixed-width encoding kernel.
Instances For
Conversion relates the delivered coefficient to integer rounding, range, wrap, and clamp.
The status is retained in full. Rejection of a finite input occurs exactly when the nearest-even
coefficient is out of range under reject. The other policies always deliver a value.
Instances For
Bounded fixed-point values decode to their exact stored rational.