Files
swift-numerics/Sources/IntegerUtilities
Stephen Canon c124585c19 Skeleton of integer shift with rounding.
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.
2021-09-26 16:23:58 -04:00
..
2021-09-20 12:35:22 -04:00
2021-09-09 23:05:45 -04:00

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:) and rotated(left:) methods implement bitwise rotation for signed and unsigned integer types. The count parameter may be any BinaryInteger type.