diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-04-23 13:38:39 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-04-23 13:38:39 +0000 |
commit | 50e4c6648a9c1c8e0b9fe047c2f89896c7893252 (patch) | |
tree | 793e7ea3e7c608c41958fd93397542dba165f542 /src/zeta.c | |
parent | ea3d4b724987e75f57ee5d715bf8d222a76a28d8 (diff) | |
download | mpfr-50e4c6648a9c1c8e0b9fe047c2f89896c7893252.tar.gz |
In various functions, use mpfr_equal_p() instead of mpfr_cmp() == 0.
Note: In these cases, the test should be false if one of the arguments
is NaN (it is not always clear whether NaN is impossible, but just in
case, mpfr_equal_p is safer, in particular if the code around changes;
and this is more readable too).
git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14493 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/zeta.c')
-rw-r--r-- | src/zeta.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/zeta.c b/src/zeta.c index 825fec4e7..628ef193e 100644 --- a/src/zeta.c +++ b/src/zeta.c @@ -520,7 +520,7 @@ mpfr_zeta (mpfr_ptr z, mpfr_srcptr s, mpfr_rnd_t rnd_mode) } /* Check for case s=1 before changing the exponent range */ - if (mpfr_cmp (s, __gmpfr_one) == 0) + if (mpfr_equal_p (s, __gmpfr_one)) { MPFR_SET_INF (z); MPFR_SET_POS (z); @@ -614,7 +614,7 @@ mpfr_zeta (mpfr_ptr z, mpfr_srcptr s, mpfr_rnd_t rnd_mode) /* Note: it might be that EXP(z_down) = emax here, in that case we will have overflow below when we multiply by 2 */ mpfr_prec_round (z_up, precz, rnd_mode); - ok = mpfr_cmp (z_down, z_up) == 0; + ok = mpfr_equal_p (z_down, z_up); mpfr_clear (z_up); mpfr_clear (z_down); if (ok) |