Import std.math.bits
UInt8
extend
Extend UInt8
Saturating arithmetic on UInt8s, which stops at the lowest and highest in place of overflowing.
-
The sum, or the lowest or highest UInt8 in place of an overflow.
Examples
Expect((250 As UInt8).SaturatingAdd(10) == 255) Expect((5 As UInt8).SaturatingSubtract(10) == 0) -
The difference, or the lowest or highest UInt8 in place of an overflow.
-
The product, or the lowest or highest UInt8 in place of an overflow.
Report an issue with this page or with FutureBlitz on GitHub.