7.12.3.1 The fpclassify macro

Synopsis

1

#include <math.h>
int fpclassify(real-floating x);

Description

2

The fpclassify macro classifies its argument value as NaN, infinite, normal, subnormal, zero, or into another implementation-defined category. First, an argument represented in a format wider than its semantic type is converted to its semantic type. Then classification is based on the type of the argument.[1]

Returns

3

The fpclassify macro returns the value of the number classification macro appropriate to the value of its argument.

4

EXAMPLE The fpclassify macro might be implemented in terms of ordinary functions as

#define fpclassify(x) \
      ((sizeof (x) == sizeof (float)) ? __fpclassifyf(x) : \
       (sizeof (x) == sizeof (double)) ? __fpclassifyd(x) : \
                                         __fpclassifyl(x))

Footnotes