Back to index

glibc  2.9
Functions
s_fpclassifyl.c File Reference
#include <math.h>
#include "math_private.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int __fpclassifyl (long double x)

Function Documentation

int __fpclassifyl ( long double  x)

Definition at line 28 of file s_fpclassifyl.c.

{
  u_int64_t hx, lx;
  int retval = FP_NORMAL;

  GET_LDOUBLE_WORDS64 (hx, lx, x);
  lx |= (hx & 0x0000ffffffffffffLL);
  hx &= 0x7fff000000000000LL;
  if ((hx | lx) == 0)
    retval = FP_ZERO;
  else if (hx == 0)
    retval = FP_SUBNORMAL;
  else if (hx == 0x7fff000000000000LL)
    retval = lx != 0 ? FP_NAN : FP_INFINITE;

  return retval;
}