> Attached is an attempt at improving things. I have added a explicit note and
> hijacked an existing example to better illustrate the purpose of the
> function.
A significant part of the complexity of the patch is the overflow-handling
implementation of (a * b % c) for 64 bits integers.
However this implementation is probably never used because int128 bits are
available and the one line implementation takes precedence, or the size is
small enough (less than 48 bits) so that there are no overflows with the
primes involved, thus the operation is done directly on 64 bits integers.
I could remove the implementation and replace it with a "not available on
this architecture" message, which would seldom be triggered: you would
have to use a 32 bits arch (?) and test against a table with about 262
Trows, which I guess does not exists anywhere. This approach would remove
about 40% of the code & comments.
Thougths?
--
Fabien.