diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-02-04 01:04:59 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-02-04 01:04:59 +0000 |
commit | 0a6ebfd2487ea512bebedfb443fa21215317fa6d (patch) | |
tree | f18ce79265c836f999a0e4d03c4603390d5004c2 /tanh.c | |
parent | efda43b6e76bc87eee0892e260b610faebf8416c (diff) | |
download | mpfr-0a6ebfd2487ea512bebedfb443fa21215317fa6d.tar.gz |
Misc bug fixes and code clean-up.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1681 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tanh.c')
-rw-r--r-- | tanh.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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; |