Command:

FPCLASSIFY(3) Linux Programmer's Manual FPCLASSIFY(3)NAMEfpclassify, isfinite, isnormal, isnan, isinf - floating-point classification macrosSYNOPSIS#include<math.h>intfpclassify(x);intisfinite(x);intisnormal(x);intisnan(x);intisinf(x);Link with-lm. Feature Test Macro Requirements for glibc (see feature_test_macros(7)):fpclassify(),isfinite(),isnormal(): _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; orcc-std=c99isnan(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE; orcc-std=c99isinf(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; orcc-std=c99DESCRIPTIONFloating 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 non-zero value if (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE)isnormal(x)returns a non-zero value if (fpclassify(x) == FP_NORMAL)isnan(x)returns a non-zero value if (fpclassify(x) == FP_NAN)isinf(x)returns 1 ifxis positive infinity, and -1 ifxis negative infinity.CONFORMINGTOC99, POSIX.1. Forisinf(), the standards merely say that the return value is non-zero if and only if the argument has an infinite value.NOTESIn glibc 2.01 and earlier,isinf() returns a non-zero value (actually: 1) ifxis positive infinity or negative infinity. (This is all that C99 requires.)SEEALSOfinite(3), INFINITY(3), isgreater(3), signbit(3)COLOPHONThis page is part of release 3.22 of the Linuxman-pagesproject. A description of the project, and informa- tion about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2008-08-07 FPCLASSIFY(3)