Back to index

glibc  2.9
Functions
s_isnanl.c File Reference
#include <math.h>
#include "ieee754.h"

Go to the source code of this file.

Functions

int __isnanl (long double value)

Function Documentation

int __isnanl ( long double  value)

Definition at line 24 of file s_isnanl.c.

{
  union ieee854_long_double u;

  u.d = value;

  /* IEEE 854 NaN's have the maximum possible
     exponent and a nonzero mantissa.  In Motorola's
     interpretation the integer bit is ignored.  */
  return ((u.ieee.exponent & 0x7fff) == 0x7fff &&
         ((u.ieee.mantissa0 & 0x7fffffff) != 0 || u.ieee.mantissa1 != 0));
}