Bounded fixed-point conversion runtime #
Bounded fixed point offers three overflow policies. reject returns outOfRange,
wrap reduces the rounded coefficient modulo 2 ^ width, and saturate clamps it
to the signed range. Conversion.Instances installs checked conversion as the
context-free default.
Overflow policy for conversion into bounded fixed point.
- reject : OverflowPolicy
Reject a rounded coefficient outside the signed destination range.
- wrap : OverflowPolicy
Reduce the rounded coefficient modulo
2 ^ width. - saturate : OverflowPolicy
Clamp the rounded coefficient to the signed destination range.
Instances For
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 complete rational observation under an explicit 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 canonically to their exact stored rational.