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

Home » Public Forums » archive » Re: Yet again, The Sky is Falling!
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: Yet again, The Sky is Falling! [message #52870 is a reply to message #52868] Thu, 08 March 2007 10:24 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
yp wrote:
> This is yet another floating point mystery, and I am unable to figure
> out which is the right way to deal:
>
> I wrote this program ("Operation") in which I made sure that all
> calculations are done in double precision. The program accepts 6
> mandatory arguments and returns the output to "result".
>
> Syntax: Operation, A, B, C, D, E, F, result
>
> I get variable results (after 3rd decimal point) when I pass some of
> the arguments as numbers and when I pass the same arguments as pre-
> defined variables.
>
> Case#1:
>
> IDL> Operation, A, B, 0.0D, 0.0D, 0.0D, F, result
> IDL> help, result
> RESULT DOUBLE = Array[7]
>
> IDL> print, result
> 1.0247013 1.0279051 1.0365066 1.0447064
> 1.0477210 1.0543893 1.0569390
>
>
> Case#2:
>
> IDL> C = (D = (E = 0.0D))
> IDL> Operation, A, B, C, D, E, F, result
> IDL> help, result
> RESULT DOUBLE = Array[7]
>
> IDL> print, result
> 1.0250284 1.0281385 1.0367149 1.0450368
> 1.0480349 1.0547703 1.0573193
>
> Why is such discrepancy? In my problem the accuracy after 3rd decimal
> point is not so important, however, after seeing the results I lose
> confidence on IDL's capability on Real number arithmetic!
>
> May be I am missing something?

Eliminating the most obvious possible problem:

Were A, B, or F modified in the first call and then not reinitialised before the second?


cheers,

paulv

--
Paul van Delst Ride lots.
CIMSS @ NOAA/NCEP/EMC Eddy Merckx
[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
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: Array resize with arbitrary arithmetic
Next Topic: mpeg creation problem

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

Current Time: Sat Oct 11 09:27:50 PDT 2025

Total time taken to generate the page: 0.47945 seconds