-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
The divRem( final BigInt div) operation is essentially the arithmetic modulo operation. Two suggestions:
- rename the method to modulo, for more clarity
- implement the much simpler subtraction-based Euclidean algorithm, as in
function gcd(a, b)
while a ≠ b
if a > b
a := a − b;
else
b := b − a;
return a;
(See image for Euclid's original source, formulated geometrically as Euclid was wont to do.)
If 2. is decided upon, I am willing to provide an implementation plus a unit test for the implementation plus a perf test comparing it side-by-side to the existing implementation.
Metadata
Metadata
Assignees
Labels
No labels
