diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-07-27 23:02:02 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-07-27 23:02:02 -0700 |
commit | d0b49b2d85ba30207964ec8bfc99d4b7fb6e1328 (patch) | |
tree | 3e9686d8043b56e4a4aa318dc860c101d7966e90 /autoload.c | |
parent | d5e8aeab7a6cb91e3144c14fed6a5d19dfb4a6db (diff) | |
download | txr-d0b49b2d85ba30207964ec8bfc99d4b7fb6e1328.tar.gz txr-d0b49b2d85ba30207964ec8bfc99d4b7fb6e1328.tar.bz2 txr-d0b49b2d85ba30207964ec8bfc99d4b7fb6e1328.zip |
gcd: rewrite for better efficiency.
* arith.c (gcd): New implementation which uses arithmetic
in the unsigned type ucnum if both operands are in that
type's range. This uses Stein's algorithm a.k.a.
binary GCD. The mpi_gcd function is used only if at least
one argument is a bignum whose value doesn't fit into
a ucnum.
* tests/016/arith.tl: gcd test cases added.
Diffstat (limited to 'autoload.c')
0 files changed, 0 insertions, 0 deletions