help-octave
[Top][All Lists]
Advanced

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

Re: Zero or not?


From: Ben Abbott
Subject: Re: Zero or not?
Date: Sat, 21 Jul 2007 13:14:21 -0400

check out the function "eps"

On Jul 21, 2007, at 12:45 PM, Matthias Brennwald wrote:

Ok. Is there a way to predict the expected offset? I need to test if
the sums across the columns of a matrix are zero, or at least within
the bounds expected from the IEEE arithmetic.

Matthias

On 21.07.2007, at 15:17, Jordi GutiƩrrez Hermoso wrote:

On 21/07/07, Matthias Brennwald <address@hidden> wrote:
I expected the below code to yield only zeros, but it does not:

That's just the way IEEE arithmetic works. When subtracting two
numbers that are very close, you may not get zero, just machine
epsilon. Try this, for fun: 0.3 - 0.2 - 0.1

- Jordi G. H.




reply via email to

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