summaryrefslogtreecommitdiff
path: root/set_d.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2006-01-19 14:53:44 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2006-01-19 14:53:44 +0000
commitaeb47f25a2660039249681d8143390c4396adced (patch)
tree182097eca901fb64674befcbab6ba84346878d4d /set_d.c
parent94ecb2d186119966e1332f6ba0c49b9418a4e618 (diff)
downloadmpfr-aeb47f25a2660039249681d8143390c4396adced.tar.gz
Replaced -0.0 by a new macro DBL_NEG_ZERO. With MSVC, the negative zero
no longer depends on the non-standard _chgsign function, as static double double_zero = 0.0; # define DBL_NEG_ZERO (-double_zero) has been reported to work. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4005 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'set_d.c')
-rw-r--r--set_d.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/set_d.c b/set_d.c
index fec7356c0..813a1e2d2 100644
--- a/set_d.c
+++ b/set_d.c
@@ -176,11 +176,9 @@ mpfr_set_d (mpfr_ptr r, double d, mp_rnd_t rnd_mode)
We can't use d==+0.0 since it should be always true,
so we check that the memory representation of d is the
same than +0.0. etc */
-#ifdef _MSC_VER
- double poszero = +0.0, negzero = _chgsign (0.0);
-#else
- double poszero = +0.0, negzero = -0.0;
-#endif
+ /* FIXME: consider the case where +0.0 or -0.0 may have several
+ representations. */
+ double poszero = +0.0, negzero = DBL_NEG_ZERO;
if (memcmp(&d, &poszero, sizeof(double)) == 0)
MPFR_SET_POS(r);
else if (memcmp(&d, &negzero, sizeof(double)) == 0)