Back to index

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

Go to the source code of this file.

Functions

int __isinfl (long double value)

Function Documentation

int __isinfl ( long double  value)

Definition at line 25 of file s_isinfl.c.

{
  union ieee854_long_double u;

  u.d = value;

  /* An IEEE 854 infinity has an exponent with the
     maximum possible value and a zero mantissa.
     In Motorola's interpretation the integer bit is ignored.  */
  if ((u.ieee.exponent & 0x7fff) == 0x7fff &&
      (u.ieee.mantissa0 & 0x7fffffff) == 0 && u.ieee.mantissa1 == 0)
    return u.ieee.negative ? -1 : 1;

  return 0;
}