Re: no backwards compatibility in IDL 5.6 [message #34233 is a reply to message #34230] |
Thu, 27 February 2003 22:52   |
Alexander Rauscher
Messages: 9 Registered: August 2001
|
Junior Member |
|
|
On Thu, 27 Feb 2003, David Fanning wrote:
*
*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
*
cool! that looks like a useful solution. especially because one can use a
_simple_ sed script to replace every atan in every *.pro. we could only
test it with 5.4 (yep, we actually "disupgraded". but who knows, with this we
might "undisupgrade" soon...) and it works...
regards,
alex
|
|
|