summaryrefslogtreecommitdiff
path: root/sin.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-12-17 13:36:51 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-12-17 13:36:51 +0000
commit047288b35205c9614b5e845389ae436ee0cd9172 (patch)
treea3a576bb1e6fb7ee18cb0d6bb582427db07d6516 /sin.c
parent39c7d106d8d50ef58ada11ab07b351e12db9269b (diff)
downloadmpfr-047288b35205c9614b5e845389ae436ee0cd9172.tar.gz
Optimize the computing of the sign of sinus if GET_EXP(x) < 0
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3153 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'sin.c')
-rw-r--r--sin.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sin.c b/sin.c
index 3a88346c7..d4d830e6f 100644
--- a/sin.c
+++ b/sin.c
@@ -34,7 +34,10 @@ mpfr_sin_sign (mpfr_srcptr x)
mpfr_srcptr y;
K = MPFR_GET_EXP(x);
- m = (K < 0) ? 0 : K;
+
+ if (K < 0) /* Trivial case if x < 1 */
+ return MPFR_SIGN (x);
+ m = K;
mpfr_init2 (c, 2);
mpfr_init2 (k, 2);