diff options
author | Stefan Krah <skrah@bytereef.org> | 2012-04-18 15:57:56 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2012-04-18 15:57:56 (GMT) |
commit | 6369f77d2006d878cd5e360d9b41c0a85fe74403 (patch) | |
tree | b6c5a1aa8a4a0d84eba844cbfaa178738acd2585 | |
parent | 140893cbaa086e0bcef9c47c11eaddd3015089c5 (diff) | |
download | cpython-6369f77d2006d878cd5e360d9b41c0a85fe74403.zip cpython-6369f77d2006d878cd5e360d9b41c0a85fe74403.tar.gz cpython-6369f77d2006d878cd5e360d9b41c0a85fe74403.tar.bz2 |
Support mythical ones' complement machines.
-rw-r--r-- | Modules/_decimal/libmpdec/mpdecimal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_decimal/libmpdec/mpdecimal.c b/Modules/_decimal/libmpdec/mpdecimal.c index f0ebca8..b456db4 100644 --- a/Modules/_decimal/libmpdec/mpdecimal.c +++ b/Modules/_decimal/libmpdec/mpdecimal.c @@ -1340,7 +1340,7 @@ mpd_qget_ssize(const mpd_t *a, uint32_t *status) if (u <= MPD_SSIZE_MAX) { return isneg ? -((mpd_ssize_t)u) : (mpd_ssize_t)u; } - else if (isneg && u-1 == MPD_SSIZE_MAX) { + else if (isneg && u+(MPD_SSIZE_MIN+MPD_SSIZE_MAX) == MPD_SSIZE_MAX) { return MPD_SSIZE_MIN; } |