Module division

Source

Macrosยง

impl_rem_assign_scalar ๐Ÿ”’

Constantsยง

FAST_DIV_WIDE ๐Ÿ”’

Functionsยง

div_half ๐Ÿ”’
For small divisors, we can divide without promoting to DoubleBigDigit by using half-size pieces of digit, like long-division.
div_rem ๐Ÿ”’
div_rem_core ๐Ÿ”’
An implementation of the base division algorithm. Knuth, TAOCP vol 2 section 4.3.1, algorithm D, with an improvement from exercises 19-21.
div_rem_digit ๐Ÿ”’
div_rem_ref ๐Ÿ”’
div_wide ๐Ÿ”’
x86 and x86_64 can use a real div instruction.
rem_digit ๐Ÿ”’
sub_mul_digit_same_len ๐Ÿ”’
Subtract a multiple. a -= b * c Returns a borrow (if a < b then borrow > 0).