Back to index

glibc  2.9
s_nearbyint.c File Reference
#include <math.h>
#include <math_ldbl_opt.h>

Go to the source code of this file.


double __nearbyint (double x)

Function Documentation

double __nearbyint ( double  x)

Definition at line 28 of file s_nearbyint.c.

  double two52 = copysign (0x1.0p52, x);
  double r;
  r = x + two52;
  r = r - two52;

  /* nearbyint(-0.1) == -0, and in general we'll always have the same sign
     as our input.  */
  return copysign (r, x);

Here is the call graph for this function: