complex math error? [message #4289] |
Wed, 17 May 1995 00:00  |
heard
Messages: 5 Registered: May 1995
|
Junior Member |
|
|
Hi,
I think we've found an erratic math error in IDL V3.6 (running on a PPC and
an SGI results were similar). Here it is:
print, exp( complex(0,1)*sqrt(2.)*10. )^sqrt(2.)
Execute the above line a time or two and you'll get the wrong answer, then try
almost any simple math operation on a complex number. i.e.,
print, complex(0,1)^2
Chances are you'll get a wrong answer again. Try the last operation again
and you might then get the correct answer. It's an erratic sort of bug and
seems to have a lot to do with complex numbers and sqrt functions. But it
is unpredictable. The only way we have been able to induce it so far is to
raise a complex exponential to a power involving a sqrt. I guess you should
be wary of any complex math in IDL until RSI has had a look at it. Also, the
bug may not exist in V4. I think that WAVE may not allow these kinds of
operations on complex values, so in a way that will protect you from this
bug (I might be wrong about this since I don't have a current WAVE version
to try it on).
------------------------------------------------------------ -------------------
Garry J. Heard heard@edrd.dnd.ca
Esquimalt Defence Research Detachment
Victoria, B.C., Canada
604/363-2905
Any opinions expressed are my own and not necessarily those of my employer.
------------------------------------------------------------ -------------------
|
|
|