diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-09-18 12:21:14 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-09-18 12:21:14 +0000 |
commit | f2a8eeceea56a58495357a759c1721e3569588b6 (patch) | |
tree | 7a8ea8412ff3b9b0756ed4adcfa64c9131ae1dff /sin.c | |
parent | dca924e4625c937e8260711b0b4e8d978c9052ba (diff) | |
download | mpfr-f2a8eeceea56a58495357a759c1721e3569588b6.tar.gz |
sin.c: extend the exponent range.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4852 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'sin.c')
-rw-r--r-- | sin.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -32,6 +32,7 @@ mpfr_sin (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) mp_prec_t precy, m; int inexact, sign, reduce; MPFR_ZIV_DECL (loop); + MPFR_SAVE_EXPO_DECL (expo); MPFR_LOG_FUNC (("x[%#R]=%R rnd=%d", x, x, rnd_mode), ("y[%#R]=%R inexact=%d", y, y, inexact)); @@ -57,6 +58,8 @@ mpfr_sin (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) MPFR_FAST_COMPUTE_IF_SMALL_INPUT (y, x, -2 * MPFR_GET_EXP (x), 2, 0, rnd_mode, {}); + MPFR_SAVE_EXPO_MARK (expo); + /* Compute initial precision */ precy = MPFR_PREC (y); m = precy + MPFR_INT_CEIL_LOG2 (precy) + 13; @@ -158,5 +161,6 @@ mpfr_sin (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode) mpfr_clear (c); mpfr_clear (xr); - return inexact; /* inexact */ + MPFR_SAVE_EXPO_FREE (expo); + return mpfr_check_range (y, inexact, rnd_mode); } |