Re: differences idl5.5 and idl5.6 [message #34218 is a reply to message #34075] |
Thu, 20 February 2003 01:01  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Paul van Delst wrote:
> Reimar Bauer wrote:
>
>> Dick Jackson wrote:
>>
>>> "Reimar Bauer" <R.Bauer@fz-juelich.de> wrote in message
>>> news:3E539FE4.4000801@fz-juelich.de...
>>>
>>>
>>>> Hi,
>>>>
>>>> today I found a difference in handling infite numbers by the new
>>>
>>> version.
>>>
>>>
>>>> IDL 5.6
>>>>
>>>> IDL> a=1./0 &print,a,fix(a)
>>>> Inf -32768
>>>>
>>>>
>>>> IDL 5.5
>>>>
>>>> IDL> a=1./0 &print,a,fix(a)
>>>> Inf 0
>>>>
>>>>
>>>>
>>>> So I can't say which is right both results are terrible.
>>>>
>>>> Now it is totally clear that this case must be tested.
>>>
>>>
>>> I don't see any change in behaviour on Windows 2000 Pro; in 5.4, 5.5 and
>>> 5.6, I get these identical results:
>>>
>>> IDL> a=1./0 &print,a,fix(a)
>>> Inf 0
>>> % Program caused arithmetic error: Floating divide by 0
>>> % Program caused arithmetic error: Floating illegal operand
>>>
>>> Cheers,
>>> --
>>> -Dick
>>>
>>> Dick Jackson / dick@d-jackson.com
>>> D-Jackson Software Consulting / http://www.d-jackson.com
>>> Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392
>>>
>>>
>>
>> Thanks Dick,
>>
>> then it seems to be a bug on linux and aix
>>
>> on aix the result is a bit more different,
>> IDL> a=1./0 & print,a,fix(a)
>> Inf -1
>>
>> I would prefer as result NaN!
>
>
> Hmm. Wouldn't the integer form of infinity still be infinite? If you think the value of
> some variable may be infinite, how come you don't test the value _before_ using it in an
> intrinsic function (e.g. FIX()) ?
Normally we check this but sometimes we missed it. The problem now is
that it is not easy to find because of the different results it gives on
different platforms.
The routine which was going wrong now was written in 1997. As it was
programmed no one thougt about that it makes sense to use this routine
with only one color.
And for the people which were using it with only one color it works
perfectly in the past.
For crossplatform programming it is better that failures are described
same on each of the idl platforms. (My feeling) In the past it was this way.
regards
Reimar
>
> I.e.
>
> IF ( FINITE( a ) ) THEN a = FIX( a ) ELSE a = !VALUES.F_NAN
>
> And from the IDL docs, it would appear that there is no such thing as an integer infinity
> or nan (in IDL at least).
>
> paulv
>
--
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
============================================================ =======
|
|
|