Re: no backwards compatibility in IDL 5.6 [message #34248 is a reply to message #34244] |
Thu, 27 February 2003 11:17   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Mark Hadfield (m.hadfield@niwa.cri.nz) writes:
> So yes, the critics are right: backwards incompatibility has been
> impaired. But the damage was done in 5.5 and the changes in 5.6
> represent an attempt to restore the old behaviour (but you have to add
> a keyword).
I've added an article on my web page with a little
program that produces the same results in IDL 5.4, 5.5,
and 5.6 on my machine.
http://www.dfanning.com/math_tips/atan_change.html
I'd be curious to know if this solves the problem for
everyone:
FUNCTION ATAN_COMPLEX_WRAPPER, complexNum
returnValue = 0.0
version = Float(!VERSION.Release)
CASE 1 OF
(version LE 5.4): ok = Execute('returnValue = ATAN(complexNum)')
(version EQ 5.5): BEGIN
realpart = Real_Part(complexNum)
imgpart = Imaginary(complexNum)
ok = Execute('returnValue = ATAN(realpart, imgpart)')
END
(version GE 5.6): ok = Execute('returnValue = ' + $
'ATAN(complexNum, /Phase)')
ENDCASE
RETURN, returnValue
END
Cheers,
David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|