Back to index

glibc  2.9
Functions
s_rint.c File Reference
#include "math.h"

Go to the source code of this file.

Functions

double __rint (double x)

Function Documentation

double __rint ( double  x)

Definition at line 23 of file s_rint.c.

{
  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;
}

Here is the call graph for this function: