diff options
author | Torbjorn Granlund <tege@gmplib.org> | 2012-02-11 12:51:21 +0100 |
---|---|---|
committer | Torbjorn Granlund <tege@gmplib.org> | 2012-02-11 12:51:21 +0100 |
commit | a4cdc3d613b1571b7b6e6229dc79fedb0dbfa99d (patch) | |
tree | 490ceb211d0417d0c0db3237e16a143e8e1d9809 /mpz/get_si.c | |
parent | 742c01ed5a51098862b9515c373022e71c80a412 (diff) | |
download | gmp-a4cdc3d613b1571b7b6e6229dc79fedb0dbfa99d.tar.gz |
(ABS_CAST): New macro.
Diffstat (limited to 'mpz/get_si.c')
-rw-r--r-- | mpz/get_si.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mpz/get_si.c b/mpz/get_si.c index d24a4e47d..2f8a4738c 100644 --- a/mpz/get_si.c +++ b/mpz/get_si.c @@ -34,10 +34,10 @@ mpz_get_si (mpz_srcptr z) __GMP_NOTHROW #endif if (size > 0) - return (long) zl & LONG_MAX; + return zl & LONG_MAX; else if (size < 0) /* This expression is necessary to properly handle 0x80000000 */ - return ~(((long) zl - 1L) & LONG_MAX); + return -1 - (long) ((zl - 1) & LONG_MAX); else return 0; } |