1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL, 2002-07-27 Walter Harms
3 .\" This was done with the help of the glibc manual.
5 .\" 2004-10-31, aeb, corrected
6 .TH fpclassify 3 2004-10-31 "" "Linux Programmer's Manual"
8 fpclassify, isfinite, isnormal, isnan \- floating-point classification macros
13 .BI "int fpclassify(" x );
15 .BI "int isfinite(" x );
17 .BI "int isnormal(" x );
24 Compile with -std=c99; link with \-lm.
26 Floating point numbers can have special values, such as
27 infinite or NaN. With the macro
29 you can find out what type
31 is. The macro takes any floating-point expression as argument.
32 The result takes one of the following values:
40 is either plus or minus infinity.
48 is too small to be represented in normalized format.
51 if nothing of the above is correct that it must be a
52 normal floating-point number.
54 The other macros provide a short answer to some standard questions.
57 returns a non-zero value if
59 (fpclassify(x) != FP_NAN && fpclassify(x) != FP_INFINITE)
62 returns a non-zero value if
63 (fpclassify(x) == FP_NORMAL)
66 returns a non-zero value if
67 (fpclassify(x) == FP_NAN)
70 returns a non-zero value if
71 (fpclassify(x) == FP_INFINITE)
73 On systems conforming to BSD 4.3,
75 will return 1 for positive, and \-1 for negative infinity.