isinf(x)
bool isinf (float x); bool isinf (double x); bool isinf (long double x);
int
float
double
long double
bool
true
false
123456789101112
/* isinf example */ #include <stdio.h> /* printf */ #include <math.h> /* isinf, sqrt */ int main() { printf ("isinf(0.0) : %d\n",isinf(0.0)); printf ("isinf(1.0/0.0) : %d\n",isinf(1.0/0.0)); printf ("isinf(-1.0/0.0) : %d\n",isinf(-1.0/0.0)); printf ("isinf(sqrt(-1.0)): %d\n",isinf(sqrt(-1.0))); return 0; }
isinf(0.0) : 0 isinf(1.0/0.0) : 1 isinf(-1.0/0.0) : 1 isinf(sqrt(-1.0): 0