One of the reasons for NaN is that there is no idea of โโthe โdirectionโ that takes on this infinite meaning. With real numbers lim a->inf : exp(a) -> + infinity . Clearly defined directions give an intuitive sense of why:
1/(+0) = +inf , 1.0 / (-0.0) = -inf and:
1/(+inf) = +0 , 1/(-inf) = -0
Continuing this to the complex plane: cexp([-]inf + bI) = [-]inf.{cos(b) + I.sin(b)}
Despite the fact that the result is infinite, the concept of direction still exists, for example, if b = - PI/2 โ cexp(+inf + bI) = +inf.(-I)
If b = [-]inf , then the direction in which infinity approaches is uncertain. There are an infinite number of directions, and the values โโfor cos(b) and sin(b) undefined. It is not surprising that the real functions cos[f|l] and sin[f|l] return a NaN if the argument is infinite.
This is not a very formal answer, I'm afraid - just "feel" the idea. I understand that there are other good reasons for this behavior, such as using branch cuts in complex analysis.
source share