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

Home » Public Forums » archive » Re: machine precision
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: machine precision [message #66504 is a reply to message #66503] Mon, 18 May 2009 06:30 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Wox writes:

> Ow boy, sorry for bringing this up again, but in the last example
> given in your famous article, why is:
>
> f=470.0 - (4.70*100)
> d=470d - (4.70d*100)
> print,'Bigger than precision:',f,(machar()).eps
> print,'Smaller than precision:',d,(machar(/double)).eps
>
> I understand that when you give 4.7 to a computer, it stores a number
> close to it. When given 4.70d, the same thing happens, only now we're
> closer than with single-precision. Why is the machine precision (EPS
> from machar) not reflecting this?

I think the MACHAR values *do* reflect this. But the point
is, when you compare two numbers that are nearly equal
to each other, the *difference* can easily happen in
the significant digits that can be garbage (or, rather,
undefined) in a floating point number. That is to say,
the difference can be in the part of the number that is
beyond the realm of floating point accuracy.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[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
Previous Topic: Re: Simultaneous fitting in IDL
Next Topic: Simultaneous fitting in IDL

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

Current Time: Sat Oct 11 00:45:37 PDT 2025

Total time taken to generate the page: 1.76082 seconds