C isinf function tells if argument is infinite

Syntax

C isinf function has the following syntax.

int isinf(fpval)

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.





















Home »
  C Language »
    Function Reference »




assert.h
ctype.h
math.h
setjmp.h
signal.h
stdio.h
stdlib.h
string.h
time.h
wctype.h