comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: differences idl5.5 and idl5.6
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: differences idl5.5 and idl5.6 [message #34075 is a reply to message #34074] Wed, 19 February 2003 08:56 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
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()) ?

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

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Ph: (301)763-8000 x7274
Fax:(301)763-8545
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Check if coordinate is in array
Next Topic: running out of memory! can all memory be restored in idl?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 23:19:35 PDT 2025

Total time taken to generate the page: 1.03939 seconds