diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-05-25 23:21:10 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-05-25 23:21:10 -0700 |
commit | a2279254bc56443ce4c9f0dd4cc51cf627332c4d (patch) | |
tree | d191fad80c880f1e4fe8ded972e5ea20142f4db7 /txr.1 | |
parent | 11b5c567124a61d8e8249a0fbcce47f2688573c6 (diff) | |
download | txr-a2279254bc56443ce4c9f0dd4cc51cf627332c4d.tar.gz txr-a2279254bc56443ce4c9f0dd4cc51cf627332c4d.tar.bz2 txr-a2279254bc56443ce4c9f0dd4cc51cf627332c4d.zip |
mpi: avoid additive inverse of most negative integer.
* mpi.c (mp_set_int, mp_set_intptr, mp_set_double_intptr):
When the signed input is negative, do not simply calculate its
inverse with unary minus, because it could be the most
negative value that has no additive inverse. Instead, convert
to unsigned first, then apply the unary minus to the unsigned
type, which calculates the two's complement.
Diffstat (limited to 'txr.1')
0 files changed, 0 insertions, 0 deletions