summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/dbl-64/e_remainder.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/dbl-64/e_remainder.c')
-rw-r--r--sysdeps/ieee754/dbl-64/e_remainder.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_remainder.c b/sysdeps/ieee754/dbl-64/e_remainder.c
index 28689614f0..7f3a02b3c2 100644
--- a/sysdeps/ieee754/dbl-64/e_remainder.c
+++ b/sysdeps/ieee754/dbl-64/e_remainder.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ * Copyright (C) 2001-2015 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -33,6 +33,7 @@
#include "mydefs.h"
#include "urem.h"
#include "MathLib.h"
+#include <math.h>
#include <math_private.h>
/**************************************************************************/
@@ -66,7 +67,7 @@ __ieee754_remainder (double x, double y)
return (xx != 0) ? xx : ((x > 0) ? ZERO.x : nZERO.x);
else
{
- if (ABS (xx) > 0.5 * t.x)
+ if (fabs (xx) > 0.5 * t.x)
return (z > d) ? xx - t.x : xx + t.x;
else
return xx;
@@ -98,10 +99,10 @@ __ieee754_remainder (double x, double y)
z = u.x * r.x;
d = (z + big.x) - big.x;
u.x = (u.x - d * w.x) - d * ww.x;
- if (ABS (u.x) < 0.5 * t.x)
+ if (fabs (u.x) < 0.5 * t.x)
return (u.x != 0) ? u.x : ((x > 0) ? ZERO.x : nZERO.x);
else
- if (ABS (u.x) > 0.5 * t.x)
+ if (fabs (u.x) > 0.5 * t.x)
return (d > z) ? u.x + t.x : u.x - t.x;
else
{
@@ -114,7 +115,7 @@ __ieee754_remainder (double x, double y)
{
if (kx < 0x7fe00000 && ky < 0x7ff00000 && (ky > 0 || t.i[LOW_HALF] != 0))
{
- y = ABS (y) * t128.x;
+ y = fabs (y) * t128.x;
z = __ieee754_remainder (x, y) * t128.x;
z = __ieee754_remainder (z, y) * tm128.x;
return z;
@@ -124,10 +125,10 @@ __ieee754_remainder (double x, double y)
if ((kx & 0x7ff00000) == 0x7fe00000 && ky < 0x7ff00000 &&
(ky > 0 || t.i[LOW_HALF] != 0))
{
- y = ABS (y);
+ y = fabs (y);
z = 2.0 * __ieee754_remainder (0.5 * x, y);
- d = ABS (z);
- if (d <= ABS (d - y))
+ d = fabs (z);
+ if (d <= fabs (d - y))
return z;
else
return (z > 0) ? z - y : z + y;