summaryrefslogtreecommitdiff
path: root/neg.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2001-10-12 12:19:49 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2001-10-12 12:19:49 +0000
commit7ce367c13c886efa67c48700ac6e0ddfed50496c (patch)
treea71f9205e6c77e013d657eeb55ae53548760052f /neg.c
parentc8e74671b4d7975cf386535eecdc2977c29abb29 (diff)
downloadmpfr-7ce367c13c886efa67c48700ac6e0ddfed50496c.tar.gz
implemented inexact flag
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1237 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'neg.c')
-rw-r--r--neg.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/neg.c b/neg.c
index b67e0c9d2..c433a5ee9 100644
--- a/neg.c
+++ b/neg.c
@@ -1,8 +1,9 @@
/* mpfr_neg -- change the sign of a floating-point number
-Copyright (C) 1999 Free Software Foundation.
+Copyright (C) 1999-2001 Free Software Foundation.
This file is part of the MPFR Library.
+Contributed by the Spaces project (LORIA/LIP6).
The MPFR Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published by
@@ -24,7 +25,7 @@ MA 02111-1307, USA. */
#include "mpfr.h"
#include "mpfr-impl.h"
-void
+int
#if __STDC__
mpfr_neg (mpfr_ptr a, mpfr_srcptr b, mp_rnd_t rnd_mode)
#else
@@ -34,7 +35,11 @@ mpfr_neg (a, b, rnd_mode)
mp_rnd_t rnd_mode;
#endif
{
- if (a != b) mpfr_set4(a, b, rnd_mode, -MPFR_SIGN(b));
- else MPFR_CHANGE_SIGN(a);
- return;
+ if (a != b)
+ return mpfr_set4 (a, b, rnd_mode, -MPFR_SIGN(b));
+ else
+ {
+ MPFR_CHANGE_SIGN(a);
+ return 0;
+ }
}