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

Home » Public Forums » archive » Re: Inaccuracies
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: Inaccuracies [message #5304 is a reply to message #5303] Tue, 14 November 1995 00:00 Go to previous messageGo to previous message
lpmix is currently offline  lpmix
Messages: 2
Registered: March 1994
Junior Member
In article <30A7BC4D.7018@cdc.noaa.gov>, Andy Loughe <afl@cdc.noaa.gov> wrote:
>
>
> TRIAL #1
> ========
> IDL> a = findgen(15)*.2 - 1.4
> IDL> print, total(a)
> 7.15256e-07
Stuff deleted***********
>
> Maybe I am missing something here, but this kind of behavior
> makes IDL a bit problematical for scientific use. With only 15
> numbers and double precision arithmetic, I can't believe this
> would fail in FORTRAN or C!
>
> --
> Andrew F. Loughe (afl@cdc.noaa.gov)
> University of Colorado, CIRES * Campus Box 449 * Boulder, CO 80309
> phone: (303) 492-0707 fax: (303) 497-7013

Try
IDL> a = findgen(8)*0.2
IDL> a = [-rotate(a(1:*), 2), a]
IDL> print, total(a, /double)
0.0000000
I'm not sure what you want to do, but expecting perfect math with
floats is not generally possible.

Paul
============================================================ ==================
L. Paul Mix
Distinguished Member of the Technical Staff
Computational Electromagnetics and Plasma Physics Department

_/_/_/ _/ _/ _/ SANDIA NATIONAL LABORATORIES _/_/_/
_/ _/_/ _/ _/ MS 1186, P.O. Box 5800 _/_/
_/_/_/ _/ _/ _/ _/ Albuquerque, NM 87185-1186 _/_/_/_/_/_/
_/ _/ _/_/ _/ E-mail: lpmix@sandia.gov _/ _/_/ _/
_/_/_/ _/ _/ _/_/_/_/ Phone: (505) 845-7493 _/ _/_/ _/
FAX: (505) 845-7890 _/_/_/
============================================================ ==================
[Message index]
 
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: How can I add parameter to curvefit?
Next Topic: XLoadCT in a procedure ?????

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

Current Time: Wed Oct 08 19:35:54 PDT 2025

Total time taken to generate the page: 0.00408 seconds