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
if (x!=x) ... then x is nan if (x>0 && x/x != x/x) ... then x is +inf if (x<0 && x/x != x/x) ... then x is -inf
this might also work (but involves call to exp() and testing equality of doubles):
if (exp(-x)==0.) ... then x is inf if (exp(x)==0.) ... then x is -inf