diff options
author | Kevin Ryde <user42@zip.com.au> | 2002-03-09 23:49:20 +0100 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2002-03-09 23:49:20 +0100 |
commit | 5548ebac58434a675c5c9daa25dbc1fe572beb0c (patch) | |
tree | 6a9e6f49e2f25c7401b64946fdf055bf8b2e965d /mpfr/tanh.c | |
parent | 9262a18b652b66e71b8fd0fb84f77e3c8588e21c (diff) | |
download | gmp-5548ebac58434a675c5c9daa25dbc1fe572beb0c.tar.gz |
* mpfr: Update to 20020301, except internal_ceil_exp2.c,
internal_ceil_log2.c, internal_floor_log2.c renamed to i_ceil_exp2.c,
i_ceil_log2.c, i_floor_log2.c to be unique in DOS 8.3. And sqrtrem.c
removed since no longer required.
Diffstat (limited to 'mpfr/tanh.c')
-rw-r--r-- | mpfr/tanh.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mpfr/tanh.c b/mpfr/tanh.c index 4f0baa5ec..13996358c 100644 --- a/mpfr/tanh.c +++ b/mpfr/tanh.c @@ -1,6 +1,6 @@ /* mpfr_tanh -- hyperbolic tangent -Copyright (C) 2001 Free Software Foundation. +Copyright (C) 2001-2002 Free Software Foundation. This file is part of the MPFR Library. @@ -50,13 +50,13 @@ mpfr_tanh (y, xt, rnd_mode) if (MPFR_IS_NAN(xt)) { MPFR_SET_NAN(y); - return 1; + MPFR_RET_NAN; } MPFR_CLEAR_NAN(y); if (MPFR_IS_INF(xt)) { - if(MPFR_SIGN(xt) > 0) + if (MPFR_SIGN(xt) > 0) return mpfr_set_si(y,1,rnd_mode); /* tanh(inf) = 1 */ else return mpfr_set_si(y,-1,rnd_mode); /* tanh(-inf) = -1 */ @@ -64,17 +64,17 @@ mpfr_tanh (y, xt, rnd_mode) MPFR_CLEAR_INF(y); /* tanh(0) = 0 */ - if(!MPFR_NOTZERO(xt)) + if (MPFR_IS_ZERO(xt)) { MPFR_SET_ZERO(y); MPFR_SET_SAME_SIGN(y,xt); - return 0; + MPFR_RET(0); } - + mpfr_init2(x,Nxt); mpfr_set(x,xt,GMP_RNDN); - if(MPFR_SIGN(x)<0) + if (MPFR_SIGN(x) < 0) { MPFR_CHANGE_SIGN(x); flag_neg=1; @@ -115,7 +115,7 @@ mpfr_tanh (y, xt, rnd_mode) mpfr_set_prec(tb,Nt); /* compute tanh */ - mpfr_mul_2exp(te,x,1,GMP_RNDN); /* 2x */ + mpfr_mul_2ui(te,x,1,GMP_RNDN); /* 2x */ mpfr_exp(te,te,GMP_RNDN); /* exp(2x) */ mpfr_add_ui(ta,te,1,GMP_RNDD); /* exp(2x) + 1*/ mpfr_sub_ui(tb,te,1,GMP_RNDU); /* exp(2x) - 1*/ |