Re: complex math error? [message #4304 is a reply to message #4289] |
Tue, 23 May 1995 00:00   |
asb
Messages: 13 Registered: May 1994
|
Junior Member |
|
|
In article <heard.1151115158F@131.136.96.1> heard@drep.dnd.ca (Garry J. Heard) writes:
Newsgroups: comp.lang.idl-pvwave
Path: nih-csl!darwin.sura.net!mojo.eng.umd.edu!bloom-beacon.mit.ed u!panix!news.mathworks.com!news.kei.com!ub!netfs.dnd.ca!drep .dnd.ca!131!heard
From: heard@drep.dnd.ca (Garry J. Heard)
Sender: nobody@drep.dnd.ca
Organization: Esquimalt Defence Research Detachment
Date: Wed, 17 May 1995 16:18:38 GMT
X-Newsreader: VersaTerm Link v1.1.3
Lines: 33
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.
The error appears to occur only when complex numbers and real numbers
are used with certain functions. The command
print, exp( complex(0,1)*sqrt(2.)*10. )^complex(sqrt(2.),0)
gives the correct result.
|
|
|