summary refs log tree commit diff
path: root/sysdeps/powerpc/fpu/s_rintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/fpu/s_rintf.c')
-rw-r--r--sysdeps/powerpc/fpu/s_rintf.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/sysdeps/powerpc/fpu/s_rintf.c b/sysdeps/powerpc/fpu/s_rintf.c
index 03aaec2c85..c29e7a22b4 100644
--- a/sysdeps/powerpc/fpu/s_rintf.c
+++ b/sysdeps/powerpc/fpu/s_rintf.c
@@ -19,26 +19,11 @@
 #define NO_MATH_REDIRECT
 #include <math.h>
 #include <libm-alias-float.h>
+#include <round_to_integer.h>
 
 float
 __rintf (float x)
 {
-  static const float TWO23 = 8388608.0;
-
-  if (fabsf (x) < TWO23)
-    {
-      if (x > 0.0)
-	{
-	  x += TWO23;
-	  x -= TWO23;
-	}
-      else if (x < 0.0)
-	{
-	  x = TWO23 - x;
-	  x = -(x - TWO23);
-	}
-    }
-
-  return x;
+  return round_to_integer_float (RINT, x);
 }
 libm_alias_float (__rint, rint)