Functions

  • /Two argument addition of raw slices: a += b
  • Divide a two digit numerator by a one digit divisor, returns quotient and remainder:
  • Uses the lehemer algorithm. Based on https://github.com/golang/go/blob/master/src/math/big/int.go#L612 If extended is set, the Bezout coefficients are calculated, otherwise they are None.
  • Find last set bit fls(0) == 0, fls(u32::MAX) == 32
  • Divide two integers, and ceil the result.
  • Jacobi returns the Jacobi symbol (x/y), either +1, -1, or 0. The y argument must be an odd integer.
  • Three argument multiply accumulate: acc += b * c
  • Three argument multiply accumulate: acc += b * c
  • Calculate the modular inverse of g. Implementation is based on the naive version from wikipedia.
  • Subtract with borrow:
  • XGCD sets z to the greatest common divisor of a and b and returns z. If extended is true, XGCD returns their value such that z = ax + by.