fpclassify Macro

Classifies its argument as one of several floating-point categories.

Include

<math.h>

Prototype

int isgreater(floating-point x);

Argument

x
any floating-point number

Return Value

Classifies its argument as one of several floating-point categories, such as FP_NAN, FP_ZERO etc.

Example

#include <math.h>
#include <stdio.h>

int main(void)
{
  double x;
  int b;
  x = 0.0;
  b = fpclassify(x);
  if(b == FP_ZERO)
    printf("The value %f has been classified as a floating-point zero\n", x);
}

Example Output

The value 0.000000 has been classified as a floating-point zero