summaryrefslogtreecommitdiff
path: root/sin.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2002-02-04 01:04:59 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2002-02-04 01:04:59 +0000
commit0a6ebfd2487ea512bebedfb443fa21215317fa6d (patch)
treef18ce79265c836f999a0e4d03c4603390d5004c2 /sin.c
parentefda43b6e76bc87eee0892e260b610faebf8416c (diff)
downloadmpfr-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 'sin.c')
-rw-r--r--sin.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sin.c b/sin.c
index 8d625159c..9dd2b7ab0 100644
--- a/sin.c
+++ b/sin.c
@@ -1,6 +1,6 @@
/* mpfr_sin -- sine of a floating-point number
-Copyright (C) 2001 Free Software Foundation, Inc.
+Copyright (C) 2001-2002 Free Software Foundation, Inc.
This file is part of the MPFR Library.
@@ -19,7 +19,6 @@ along with the MPFR Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
-#include <stdio.h>
#include "gmp.h"
#include "gmp-impl.h"
#include "mpfr.h"
@@ -34,13 +33,15 @@ mpfr_sin (mpfr_ptr y, mpfr_srcptr x, mp_rnd_t rnd_mode)
if (MPFR_IS_NAN(x) || MPFR_IS_INF(x))
{
MPFR_SET_NAN(y);
- return 1; /* inexact */
+ MPFR_RET_NAN;
}
- if (!MPFR_NOTZERO(x))
+ if (MPFR_IS_ZERO(x))
{
- mpfr_set_ui (y, 0, GMP_RNDN);
- return 0; /* exact */
+ MPFR_CLEAR_FLAGS(y);
+ MPFR_SET_ZERO(y);
+ MPFR_SET_SAME_SIGN(y, x);
+ MPFR_RET(0);
}
precy = MPFR_PREC(y);