C isinf function tells if argument is infinite
Syntax
C isinf function has the following syntax.
int isinf(fpval)
Header
C isinf function is
from header file math.h
.
Description
C isinf function returns nonzero if fpval
is infinite.
Example
The following code can tell if argument is infinite by using C isinf function.
#include <stdio.h>
#include <math.h>
/*from w w w .j ava2 s .c o m*/
int main(void)
{
printf("isinf(-1.0) %d\n", isinf(-1.0));
printf("isinf(1.0) %d\n", isinf(1.0));
printf("isinf(1.0/0.0) %d\n", isinf(1.0/0.0));
return 0;
}
The code above generates the following result.