motoko-base icon indicating copy to clipboard operation
motoko-base copied to clipboard

Possible improvements for `Int8/16/32/64`

Open luc-blaeser opened this issue 2 years ago • 0 comments

Possible improvements for Int8.mo, Int16.mo, Int32.mo, and Int64:

  • Support matchers with Int8/16/32/64/Nat8/16/32/64/Float/Order Testable.
  • Inconsistent naming of functions, e.g. bitrotLeft() (instead of bitRotLeft()).
  • Inconsistent type of second argument in bit operations: bitshiftLeft() uses Int64 but bittest() uses Nat.

Already fixed by PR https://github.com/dfinity/motoko-base/pull/478:

  • Minimum value and maximum value constants are missing.
  • bitnot() has a superfluous second argument: bitnot(x, y) should be bitnot(x).

luc-blaeser avatar Dec 21 '22 16:12 luc-blaeser