I'm rewriting MatLab code into C and need to send values to a complex error function. The erfcomp function produces Nan and Inf values, but when I try to return these values to my other function and store them under a new variable, they somehow become numbers. My problem is that I need to stop a loop once Nan or Inf is reached.
Is it possible to return Nan or Inf values to a function or I am I wasting my time by not looking for another approach to this?
Thanks in advance.