diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-02-01 21:35:34 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-02-01 21:35:34 +0000 |
commit | 6e879c6f3361346ede165d0733a26e9145cccf69 (patch) | |
tree | ba27f0eb5a934b1be7da19ed5937cb8f7b076608 /cosh.c | |
parent | d2a8d03f413280358567c13baa9b2e1f6e3349bf (diff) | |
download | mpfr-6e879c6f3361346ede165d0733a26e9145cccf69.tar.gz |
Misc bug fixes and code clean-up.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1678 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'cosh.c')
-rw-r--r-- | cosh.c | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -1,6 +1,6 @@ /* mpfr_cosh -- hyperbolic cosine -Copyright (C) 2001 Free Software Foundation. +Copyright (C) 2001-2002 Free Software Foundation. This file is part of the MPFR Library. @@ -42,7 +42,7 @@ mpfr_cosh (mpfr_ptr y, mpfr_srcptr xt , mp_rnd_t rnd_mode) if (MPFR_IS_NAN(xt)) { MPFR_SET_NAN(y); - return 1; + MPFR_RET_NAN; } MPFR_CLEAR_NAN(y); @@ -51,21 +51,16 @@ mpfr_cosh (mpfr_ptr y, mpfr_srcptr xt , mp_rnd_t rnd_mode) MPFR_SET_INF(y); if (MPFR_SIGN(y) < 0) MPFR_CHANGE_SIGN(y); - return 0; + MPFR_RET(0); } MPFR_CLEAR_INF(y); - if(!MPFR_NOTZERO(xt)) - return mpfr_set_ui(y,1,rnd_mode); /* cosh(0) = 1 */ + if (MPFR_IS_ZERO(xt)) + return mpfr_set_ui(y,1,rnd_mode); /* cosh(0) = 1 */ mpfr_init2(x,Nxt); - mpfr_set(x,xt,GMP_RNDN); - - if(MPFR_SIGN(x)<0) - { - MPFR_CHANGE_SIGN(x); - } + mpfr_set4(x, xt, GMP_RNDN, 1); /* General case */ { |