C examples for math.h:isnormal
macro/function
<cmath> <ctgmath> <math.h>
Returns whether x is a normal value: i.e., whether it is neither infinity, NaN, zero or subnormal.
bool isnormal (float x); bool isnormal (double x); bool isnormal (long double x); isnormal(x)
Parameter | Description |
---|---|
x | A floating-point value. |
A non-zero value (true) if x is normal; and zero (false) otherwise.
#include <stdio.h> #include <math.h> /* isnormal */ int main()//w w w . java2 s . c o m { int a = 0; printf ("%d\n",isnormal(1.0)); printf ("%d\n",isnormal(0.0)); printf ("%d\n",isnormal(1.0/a)); return 0; }