delorie.com/djgpp/doc/libc/libc_340.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

fpclassify

Syntax

 
#include <math.h>

Description

The macro fpclassify returns the kind of the floating point value supplied.

Return Value

FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL, FP_ZERO or FP_UNNORMAL.

Portability

ANSI/ISO C C99; not C89

Example

 
float f = 1;
double d = INFINITY;
long double ld = NAN;

if( fpclassify(f) != FP_NORMAL )
{
  printf("Something is wrong with the implementation!\n");
}
if( fpclassify(d) != FP_INFINITE )
{
  printf("Something is wrong with the implementation!\n");
}
if( fpclassify(ld) != FP_NAN )
{
  printf("Something is wrong with the implementation!\n");
}


  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004