Skip to main content

Module division

Module division 

Source

MacrosΒ§

impl_rem_assign_scalar πŸ”’

ConstantsΒ§

BURNIKEL_ZIEGLER_THRESHOLD πŸ”’
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_burnikel_ziegler πŸ”’
This algorithm is from Burnikel and Ziegler, β€œFast Recursive Division”, Algorithm 1. It is a recursive algorithm that divides the dividend and divisor into blocks of digits and uses a divide-and-conquer approach to find the quotient.
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_cow πŸ”’
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).