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

Home » Public Forums » archive » Re: mean() function
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: mean() function [message #46924 is a reply to message #46900] Wed, 11 January 2006 06:19 Go to previous messageGo to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
>
> [...]
>
> I suppose math libraries or compilers changed between 6.1 and 6.2.
>
> Once the values you are adding differ by 6-7 orders of magnitude,
> precision is completely lost for single precision floats.
>
> IDL> print, total(replicate(1.0, 10^7))
> 1.00000e+07
> IDL> print, total(replicate(1.0, 10^8))
> 1.67772e+07
> IDL> print, total(replicate(1.0D0, 10^8))
> 1.0000000e+08

I have no problem with that, understanding the argument of finite
precision and all that, but there is one thing which has me puzzling
(all commands issued from the same linux machine)


IDL Version 5.4 (linux x86). (c) 2000, Research Systems, Inc.

IDL> help,total(replicate(1.,1d8))
<Expression> FLOAT = 1.67772e+07
IDL> exit


IDL Version 5.5a (linux x86). (c) 2001, Research Systems, Inc.

IDL> help,total(replicate(1.,1d8))
<Expression> FLOAT = 6.71089e+07
IDL> exit


IDL Version 5.6 (linux x86 m32). (c) 2002, Research Systems, Inc.

IDL> help,total(replicate(1.,1d8))
<Expression> FLOAT = 1.00000e+08
IDL> exit

I was thinking that the result of the operation would depend
on the hardware used, but I would have guessed that on the same
machine no difference would be seen between different versions
of IDL, since all of them should represent floats in the same way...

So what's happening here? Different compiler optimizations?

Ciao,
Paolo


>
> Cheers, Ken
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: reading a ninary file
Next Topic: mean() function

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

Current Time: Sun Oct 12 03:58:30 PDT 2025

Total time taken to generate the page: 0.07960 seconds