Back to index

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

Go to the source code of this file.

Functions

double __round (double x)

Function Documentation

double __round ( double  x)

Definition at line 24 of file s_round.c.

{
  const double almost_half = 0x1.fffffffffffffp-2;
  const double two52 = 0x1.0p52;
  double tmp, r;

  __asm (
#ifdef _IEEE_FP_INEXACT
        "addt/suic %2, %3, %1\n\tsubt/suic %1, %3, %0"
#else
        "addt/suc %2, %3, %1\n\tsubt/suc %1, %3, %0"
#endif
        : "=&f"(r), "=&f"(tmp)
        : "f"(fabs (x) + almost_half), "f"(two52));

  return copysign (r, x);
}

Here is the call graph for this function: