summaryrefslogtreecommitdiff
path: root/mpf
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2014-06-02 08:36:32 +0200
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2014-06-02 08:36:32 +0200
commit8c6ecacf075996730c75732b76aac5a21f718a3e (patch)
tree3d5575a0fc30ed549c2c8b95c8aab93bb1ba98f2 /mpf
parentdf9e5e8eb482f5aa9de149ff194451ed866b2ba0 (diff)
downloadgmp-8c6ecacf075996730c75732b76aac5a21f718a3e.tar.gz
mpf/fits_?.h: No special case for SIZ == 0.
Diffstat (limited to 'mpf')
-rw-r--r--mpf/fits_s.h7
-rw-r--r--mpf/fits_u.h6
2 files changed, 5 insertions, 8 deletions
diff --git a/mpf/fits_s.h b/mpf/fits_s.h
index ec2635f65..25f323e25 100644
--- a/mpf/fits_s.h
+++ b/mpf/fits_s.h
@@ -1,6 +1,6 @@
/* mpf_fits_s*_p -- test whether an mpf fits a C signed type.
-Copyright 2001, 2002 Free Software Foundation, Inc.
+Copyright 2001, 2002, 2014 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -42,14 +42,11 @@ FUNCTION (mpf_srcptr f) __GMP_NOTHROW
mp_exp_t exp;
mp_limb_t fl;
- fs = SIZ(f);
- if (fs == 0)
- return 1; /* zero fits */
-
exp = EXP(f);
if (exp < 1)
return 1; /* -1 < f < 1 truncates to zero, so fits */
+ fs = SIZ (f);
fp = PTR(f);
fn = ABS (fs);
diff --git a/mpf/fits_u.h b/mpf/fits_u.h
index 65ac60e09..be7a271b2 100644
--- a/mpf/fits_u.h
+++ b/mpf/fits_u.h
@@ -1,6 +1,6 @@
/* mpf_fits_u*_p -- test whether an mpf fits a C unsigned type.
-Copyright 2001, 2002, 2013 Free Software Foundation, Inc.
+Copyright 2001, 2002, 2013, 2014 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -47,8 +47,8 @@ FUNCTION (mpf_srcptr f) __GMP_NOTHROW
return 1; /* -1 < f < 1 truncates to zero, so fits */
fn = SIZ(f);
- if (fn <= 0)
- return fn == 0; /* zero fits, negatives don't */
+ if (fn < 0) /* zero catched by exp == 0 */
+ return 0; /* negatives don't fit */
fp = PTR(f);