diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-04-05 20:04:40 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-04-05 20:04:40 -0700 |
commit | 41bd4e38da467b22655ca4b81fda22bd3afd6f95 (patch) | |
tree | 1d02c58764645049b6542e21e3407138cedfa3af /tests/002/proc/32675 | |
parent | 6a9a84f20e925f76f58d935d9844215af4bf0363 (diff) | |
download | txr-41bd4e38da467b22655ca4b81fda22bd3afd6f95.tar.gz txr-41bd4e38da467b22655ca4b81fda22bd3afd6f95.tar.bz2 txr-41bd4e38da467b22655ca4b81fda22bd3afd6f95.zip |
mpi: use integer math for radix length.
* mpi/logtab.h: Regenerated.
(s_logv_2): Now table of scaled integers.
(MP_LOG_SCALE): New constant.
* mpi/make-logtab.txr (scale, type): New variables.
Generate integer table with log2 values scaled by the scale
factor, rounded up.
* mpi/config.h (MP_LOGTAB): Removed. We always use the table.
* mpi/mpi.c: Unconditionally include logtab.h.
(LOG_V_2): Macro removed.
(s_mp_outlen): Rewritten using scaled integer math.
Overflow is avoided by splitting the input into a part that is
an exact multiple of the scale factor, and a remaining
part. Only the remaining part need be multiplied by a value
from the table before dividing by the scale factor.
Diffstat (limited to 'tests/002/proc/32675')
0 files changed, 0 insertions, 0 deletions