Functionsยง
- __add2
- __
sub2rev - adc
- add2
- /Two argument addition of raw slices: a += b
- biguint_
shl - biguint_
shr - cmp_
slice - div_rem
- div_
rem_ digit - div_
wide - Divide a two digit numerator by a one digit divisor, returns quotient and remainder:
- extended_
gcd - 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 areNone
. - fls
- Find last set bit fls(0) == 0, fls(u32::MAX) == 32
- idiv_
ceil - Divide two integers, and ceil the result.
- ilog2
- jacobi
- Jacobi returns the Jacobi symbol (x/y), either +1, -1, or 0. The y argument must be an odd integer.
- mac3
- Three argument multiply accumulate: acc += b * c
- mac_
digit - Three argument multiply accumulate: acc += b * c
- mac_
with_ carry - mod_
inverse - Calculate the modular inverse of
g
. Implementation is based on the naive version from wikipedia. - mul3
- mul_
with_ carry - sbb
- Subtract with borrow:
- scalar_
mul - sub2
- sub2rev
- sub_
sign - xgcd
- 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.