Back to index

glibc  2.9
Functions
s_fpclassify.c File Reference
#include <math.h>
#include "math_private.h"

Go to the source code of this file.

Functions

int __fpclassify (double x)

Function Documentation

int __fpclassify ( double  x)

Definition at line 27 of file s_fpclassify.c.

{
  u_int32_t hx, lx;
  int retval = FP_NORMAL;

  EXTRACT_WORDS (hx, lx, x);
  lx |= hx & 0xfffff;
  hx &= 0x7ff00000;
  if ((hx | lx) == 0)
    retval = FP_ZERO;
  else if (hx == 0)
    retval = FP_SUBNORMAL;
  else if (hx == 0x7ff00000)
    retval = lx != 0 ? FP_NAN : FP_INFINITE;

  return retval;
}