6.11.95 isnormal Macro
Returns true if its argument is normal.
Include
<math.h>
Prototype
int isnormal(floating-point x);
Argument
x
- any floating-point number
Return Value
Returns true if x
is normal, i.e. it is not NaN, infinite, subnormal,
nor zero; it returns zero otherwise.
Example
See the notes at the beginning of this chapter or section for
information on using printf()
or scanf()
(and other functions reading and writing the stdin
or
stdout
streams) in the example code.
#include <math.h>
#include <stdio.h>
int main(void)
{
double x, y, z;
x = 5.0;
y = 2.0;
z = x / y;
if(isnormal(z))
printf("The division of %f by %f is normal\n", x, y);
}
Example Output
The division of 5.000000 by 2.000000 is normal