Re: no backwards compatibility in IDL 5.6 [message #34255 is a reply to message #34253] |
Thu, 27 February 2003 09:53   |
R.G. Stockwell
Messages: 363 Registered: July 1999
|
Senior Member |
|
|
William Thompson wrote:
> "R.G. Stockwell" <sorry@noemail.now> writes:
>
>
>> Alexander Rauscher wrote:
>>
>>> sorry for posting the same thing twice under different subjects, but i
>>> think this is important...
>>>
>>> many of idl programs have to be adapted due do the non existing
>>> backwards compatibility of atan (and probably many other functions) .
>>> one wouldn't expect a change in such a fundamental function. so now
>>> atan(z, /phase) gives the same result as atan(z) in older versions did,
>>> where z is (re,im)... this is worse than stupid. this is dangerous.
...
> Evidently, the change in behavior was introduced in 5.5 or 5.5a. This is how
> it works under 5.4.1 and previous versions of IDL.
>
> IDL> print,atan(complex(4,4))
> 0.785398
>
> So the point is that you need to change your code to *ADD* the /PHASE keyword
> to recover the previous behavior. That's definitely a case of something not
> being backwardly compatible. To make it worse, you have to put in an IF
> statement to correctly handle the various cases, e.g. 5.4, 5.5, and 5.6, which
> all act differently.
OUCH!
well, if one has to rewrite a ton a code, i humbly suggest
greply "search-and-replace"-ing all "atan(" with the new user function "user_atan(",
where the "user_atan(" is written correctly.
Through dumb luck I had a tiny function called arg() that i always used, so
this did problem went unnoticed through the version changes. whew.
Cheers,
bob
|
|
|