diff options
-rw-r--r-- | coth.c | 6 | ||||
-rw-r--r-- | tests/tcoth.c | 10 |
2 files changed, 8 insertions, 8 deletions
@@ -24,15 +24,15 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., coth (NaN) = NaN. coth (+Inf) = 1 coth (-Inf) = -1 - coth (+0) = +0. - coth (-0) = -0. + coth (+0) = +Inf. + coth (-0) = -Inf. */ #define FUNCTION mpfr_coth #define INVERSE mpfr_tanh #define ACTION_NAN(y) do { MPFR_SET_NAN(y); MPFR_RET_NAN; } while (1) #define ACTION_INF(y) return mpfr_set_si (y, MPFR_IS_POS(x) ? 1 : -1, rnd_mode) -#define ACTION_ZERO(y,x) do { MPFR_SET_SAME_SIGN(y,x); MPFR_SET_ZERO(y); \ +#define ACTION_ZERO(y,x) do { MPFR_SET_SAME_SIGN(y,x); MPFR_SET_INF(y); \ MPFR_RET(0); } while (1) /* We know |coth(x)| > 1, thus if the approximation z is such that diff --git a/tests/tcoth.c b/tests/tcoth.c index e3508437b..78557880e 100644 --- a/tests/tcoth.c +++ b/tests/tcoth.c @@ -60,19 +60,19 @@ check_specials (void) exit (1); } - /* cot(+/-0) = +/-0 */ + /* coth(+/-0) = +/-Inf */ mpfr_set_ui (x, 0, MPFR_RNDN); mpfr_coth (y, x, MPFR_RNDN); - if (! (mpfr_zero_p (y) && MPFR_SIGN (y) > 0)) + if (! (mpfr_inf_p (y) && MPFR_SIGN (y) > 0)) { - printf ("Error: coth(+0) != +0\n"); + printf ("Error: coth(+0) != +Inf\n"); exit (1); } mpfr_neg (x, x, MPFR_RNDN); mpfr_coth (y, x, MPFR_RNDN); - if (! (mpfr_zero_p (y) && MPFR_SIGN (y) < 0)) + if (! (mpfr_inf_p (y) && MPFR_SIGN (y) < 0)) { - printf ("Error: coth(-0) != -0\n"); + printf ("Error: coth(-0) != -Inf\n"); exit (1); } |