Provided by: manpages-dev_3.35-0.1ubuntu1_all

**NAME**

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

**SYNOPSIS**

#include<math.h>intfpclassify(x);intisfinite(x);intisnormal(x);intisnan(x);intisinf(x);Link with-lm. Feature Test Macro Requirements for glibc (seefeature_test_macros(7)):fpclassify(),isfinite(),isnormal(): _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L; orcc-std=c99isnan(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L; orcc-std=c99isinf(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L; orcc-std=c99

**DESCRIPTION**

Floating point numbers can have special values, such as infinite or NaN. With the macrofpclassify(x)you can find out what typexis. The macro takes any floating-point expression as argument. The result is one of the following values:FP_NANxis "Not a Number".FP_INFINITExis either positive infinity or negative infinity.FP_ZEROxis zero.FP_SUBNORMALxis too small to be represented in normalized format.FP_NORMALif 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 ifxis positive infinity, and -1 ifxis negative infinity.

**CONFORMING** **TO**

C99, POSIX.1. Forisinf(), the standards merely say that the return value is nonzero if and only if the argument has an infinite value.

**NOTES**

In glibc 2.01 and earlier,isinf() returns a nonzero value (actually: 1) ifxis positive infinity or negative infinity. (This is all that C99 requires.)

**SEE** **ALSO**

finite(3),INFINITY(3),isgreater(3),signbit(3)

**COLOPHON**

This page is part of release 3.35 of the Linuxman-pagesproject. A description of the project, and information about reporting bugs, can be found at http://man7.org/linux/man- pages/. 2010-09-20 FPCLASSIFY(3)