mirror of
https://github.com/apple/swift-numerics
synced 2026-11-24 04:38:11 +00:00
Fairly correct implementation of right-shift with rounding. Also fairly efficient, though I'm sure I'll find some cases where we're generating uncessary overflow checks upon further inspection. Nonetheless, a decent enough start.
Integer Utilities
Utilities defined for BinaryInteger
The following API are defined for all integer types conforming to BinaryInteger:
- The
gcd(_:_:)free function implements the Greatest Common Divisor operation.
Utilities defined for FixedWidthInteger
- The
rotated(right:)androtated(left:)methods implement bitwise rotation for signed and unsigned integer types. The count parameter may be anyBinaryIntegertype.