In my programs infinity usually arises when a value is divided by zero. I get indeterminate when I divide zero by zero. How do you check for infinite and indeterminate value
There's isfinite from C99 or POSIX or something I think.
One hackish way to do it is to test x-x == 0; if x is infinite or NaN, then x-x is NaN so the comparison fails, while if x is finite, then x-x is 0 and the comparison succeeds. I'd recommend using isfinite, though, or packaging this test into a function/macro called something like isfinite so you can get rid of it all when the time comes.