help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 0.3*3 == 0.9?


From: CdeMills
Subject: Re: 0.3*3 == 0.9?
Date: Thu, 26 Aug 2010 06:20:40 -0700 (PDT)


Michael Creel wrote:
> 
> 
> 
> octave:1> 0.3*2 == 0.6
> ans =  1
> octave:2> 0.3*3 == 0.9
> ans = 0
> octave:3>
> 
> 

While reading one of D. Knuth books, I remember he wrote NEVER to use such
constructs for floating-points number, but instead
abs(0.3*3-.9) <= eps
which returns true.

Regards

Pascal
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/0-3-3-0-9-tp2338306p2339737.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]