[Top][All Lists]

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

Re: checking for tiny inequalities (was: Re: puzzling Octave behaviour)

From: Francesco Potorti
Subject: Re: checking for tiny inequalities (was: Re: puzzling Octave behaviour)
Date: Mon, 24 Jul 2006 16:20:24 +0200

>I need some clarification on the significance and use of eps. According
>to octave,
>    `eps' is the largest relative spacing between any two adjacent numbers in
>    the machine's floating point system
>Which I understand as "any number smaller than eps is undistinguishable
>from 0". 

No, you ignored the word "relative" in the above explanation.  Your
summary could be rewritten as "any two numbers whose relative difference
is smaller than eps are indistinguishable from each other".  The
relative difference between a and b is abs(a/b-1)

As an example, suppose you have a system where the mantissa is four bits
long.  Then the smallest relative difference between two numbers is
2^-4.  This means that the numbers 30 and 31 are indistinguishable, and
so are 0.00003 and 0.000031.  On the other hand, the numbers 11 and 12
can be distinguished, and so can 0.000011 and 0.000012.

Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: address@hidden
Web:           Key:

reply via email to

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