summary refs log tree commit diff
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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_remainder.c b/sysdeps/ieee754/dbl-64/e_remainder.c
index 7f3a02b3c2..4818091231 100644
--- a/sysdeps/ieee754/dbl-64/e_remainder.c
+++ b/sysdeps/ieee754/dbl-64/e_remainder.c
@@ -130,6 +130,8 @@ __ieee754_remainder (double x, double y)
 	      d = fabs (z);
 	      if (d <= fabs (d - y))
 		return z;
+	      else if (d == y)
+		return 0.0 * x;
 	      else
 		return (z > 0) ? z - y : z + y;
 	    }