diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2001-11-28 16:54:20 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2001-11-28 16:54:20 +0000 |
commit | a0386d7b05a6b0e1a277682e37989ea18232d131 (patch) | |
tree | bff14e70d6205a799e0b24011e5b994d362c8470 | |
parent | 76e993369fac6bc17a4c91eb5f953d9a900a465e (diff) | |
download | mpfr-a0386d7b05a6b0e1a277682e37989ea18232d131.tar.gz |
Particular cases fixed.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1583 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | asin.c | 10 | ||||
-rw-r--r-- | atan.c | 7 |
2 files changed, 10 insertions, 7 deletions
@@ -43,10 +43,10 @@ mpfr_asin (mpfr_ptr asin, mpfr_srcptr x, mp_rnd_t rnd_mode) int compared; /* Trivial cases */ - if (MPFR_IS_NAN(x)) + if (MPFR_IS_NAN(x) || MPFR_IS_INF(x)) { MPFR_SET_NAN(asin); - return 1; + MPFR_RET_NAN; } /* Set x_p=|x| */ @@ -54,7 +54,7 @@ mpfr_asin (mpfr_ptr asin, mpfr_srcptr x, mp_rnd_t rnd_mode) mpfr_init2 (xp, MPFR_PREC(x)); mpfr_set (xp, x, rnd_mode); if (signe == -1) - MPFR_CHANGE_SIGN(xp); + MPFR_CHANGE_SIGN(xp); compared = mpfr_cmp_ui (xp, 1); @@ -62,7 +62,7 @@ mpfr_asin (mpfr_ptr asin, mpfr_srcptr x, mp_rnd_t rnd_mode) { MPFR_SET_NAN(asin); mpfr_clear(xp); - return 1; + MPFR_RET_NAN; } if (compared == 0) /* x = 1 or x = -1 */ @@ -82,7 +82,7 @@ mpfr_asin (mpfr_ptr asin, mpfr_srcptr x, mp_rnd_t rnd_mode) return 1; /* inexact */ } - if (!MPFR_NOTZERO(x)) /* x = 0 */ + if (MPFR_IS_ZERO(x)) /* x = 0 */ { mpfr_set_ui (asin, 0, GMP_RNDN); mpfr_clear(xp); @@ -87,11 +87,12 @@ mpfr_atan (mpfr_ptr arctangent, mpfr_srcptr x, mp_rnd_t rnd_mode) if (MPFR_IS_NAN(x)) { MPFR_SET_NAN(arctangent); - return 1; + MPFR_RET_NAN; } if (MPFR_IS_INF(x)) { + MPFR_CLEAR_FLAGS(arctangent); if (MPFR_SIGN(x) > 0) /* arctan(+inf) = Pi/2 */ mpfr_const_pi (arctangent, rnd_mode); else /* arctan(-inf) = -Pi/2 */ @@ -106,7 +107,9 @@ mpfr_atan (mpfr_ptr arctangent, mpfr_srcptr x, mp_rnd_t rnd_mode) return 1; /* inexact */ } - if (!MPFR_NOTZERO(x)) + MPFR_CLEAR_FLAGS(arctangent); + + if (MPFR_IS_ZERO(x)) { mpfr_set_ui(arctangent, 0, GMP_RNDN); return 0; /* exact result */ |