about summary refs log tree commit diff
path: root/sysdeps/powerpc/fpu/s_rint.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/fpu/s_rint.c')
-rw-r--r--sysdeps/powerpc/fpu/s_rint.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/sysdeps/powerpc/fpu/s_rint.c b/sysdeps/powerpc/fpu/s_rint.c
index 8bf43e3efe..062d6b125b 100644
--- a/sysdeps/powerpc/fpu/s_rint.c
+++ b/sysdeps/powerpc/fpu/s_rint.c
@@ -19,26 +19,11 @@
 #define NO_MATH_REDIRECT
 #include <math.h>
 #include <libm-alias-double.h>
+#include <round_to_integer.h>
 
 double
 __rint (double x)
 {
-  static const float TWO52 = 4503599627370496.0;
-
-  if (fabs (x) < TWO52)
-    {
-      if (x > 0.0)
-	{
-	  x += TWO52;
-	  x -= TWO52;
-	}
-      else if (x < 0.0)
-	{
-	  x = TWO52 - x;
-	  x = -(x - TWO52);
-	}
-    }
-
-  return x;
+  return round_to_integer_double (RINT, x);
 }
 libm_alias_double (__rint, rint)