# fpclassify

## NAME



           fpclassify, isfinite, isnormal, isnan, isinf - floating-point
           classification macros
    


## LIBRARY



           Math library (_libm_ , _-lm_)
    


## SYNOPSIS



           **#include <math.h>**
    
           **int fpclassify(**_x_**);**
           **int isfinite(**_x_**);**
           **int isnormal(**_x_**);**
           **int isnan(**_x_**);**
           **int isinf(**_x_**);**
    
       Feature Test Macro Requirements for glibc (see
       feature_test_macros(7)):
    
           **fpclassify**(), **isfinite**(), **isnormal**():
               _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
    
           **isnan**():
               _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
                   || _XOPEN_SOURCE
                   || /* Since glibc 2.19: */ _DEFAULT_SOURCE
                   || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
    
           **isinf**():
               _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
                   || /* Since glibc 2.19: */ _DEFAULT_SOURCE
                   || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
    


## DESCRIPTION



           Floating point numbers can have special values, such as infinite
           or NaN.  With the macro **fpclassify(**_x_**)** you can find out what type _x_
           is.  The macro takes any floating-point expression as argument.
           The result is one of the following values:
    
           **FP_NAN** _x_ is "Not a Number".
    
           **FP_INFINITE**
                  _x_ is either positive infinity or negative infinity.
    
           **FP_ZERO**
                  _x_ is zero.
    
           **FP_SUBNORMAL**
                  _x_ is too small to be represented in normalized format.
    
           **FP_NORMAL**
                  if nothing of the above is correct then it must be a normal
                  floating-point number.
    
           The other macros provide a short answer to some standard
           questions.
    
           **isfinite(**_x_**)**
                  returns a nonzero value if
                  (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE)
    
           **isnormal(**_x_**)**
                  returns a nonzero value if (fpclassify(x) == FP_NORMAL)
    
           **isnan(**_x_**)**
                  returns a nonzero value if (fpclassify(x) == FP_NAN)
    
           **isinf(**_x_**)**
                  returns 1 if _x_ is positive infinity, and -1 if _x_ is
                  negative infinity.
    


## ATTRIBUTES



           For an explanation of the terms used in this section, see
           attributes(7).
           ┌──────────────────────────────────────┬───────────────┬─────────┐
           │ **Interface** │ **Attribute** │ **Value** │
           ├──────────────────────────────────────┼───────────────┼─────────┤
           │ **fpclassify**(), **isfinite**(),            │ Thread safety │ MT-Safe │
           │ **isnormal**(), **isnan**(), **isinf**()         │               │         │
           └──────────────────────────────────────┴───────────────┴─────────┘
    


## STANDARDS



           C11, POSIX.1-2008.
    


## NOTES



           For **isinf**(), the standards merely say that the return value is
           nonzero if and only if the argument has an infinite value.
    


* * *