Erratic behavior with complex arithmetic, e.g., sin(z) returns NaN
Sat, 06/05/2021 - 06:00 am
My code is producing unexpected results when taking the sine of a complex number. I wrote the following test function to research the problem.
variable /c a
print "a= ", a
print "sin(a)= ", sin(a)
print "sin(sqrt(-1))= ", sin(sqrt(-1))
[Click and drag to move]
The results printed in the Command Window are pasted here:
The built-in sine function is not handling complex numbers as the manual leads me to believe, i.e., sin(x+iy)=sin(x)cosh(y)+ i cos(x)sinh(y). Shouldn't this have produced the result (0, 1.1752) in both cases above, i.e., the sin(a) and sin(sqrt(-1))?