Back to index

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

Go to the source code of this file.


float __nearbyintf (float x)

Function Documentation

float __nearbyintf ( float  x)

Definition at line 27 of file s_nearbyintf.c.

  float two23 = copysignf (0x1.0p23, x);
  float r;

  r = x + two23;
  r = r - two23;

  /* 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: