help-octave
[Top][All Lists]
Advanced

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

Re: Output precision


From: JuanPi
Subject: Re: Output precision
Date: Sun, 15 Apr 2012 13:56:49 +0200

On Sun, Apr 15, 2012 at 1:02 PM, Martin Helm <address@hidden> wrote:
> Am 15.04.2012 12:40, schrieb JuanPi:
>> x = 987654321.123456789;
> x is a double precision IEEE 754 floating point variable, you can show
> the precision by using eps.
> octave:1> x = 987654321.123456789;
> octave:2> x*eps
> ans =  2.1930e-07
>
> shows that you have to expect that at least the 7th digit after the
> decimal point is wrong and this is exactly what you see.
> For your other example you run into the typical situation that some
> values which can be represented exactly in decimal representation can
> not be represented exactly in binary representation.
>
>

:O
Thank you very much, I just realized that eps is relative!!! OMG, how
could I survive all this time :(


-- 
JuanPi Carbajal
-----
"The bad economist pursues a small present good, which will be
followed by a great evil to come, while the true economist pursues a
great good to come, at the risk of a small present evil." - Frédéric
Bastiat
-----
http://ailab.ifi.uzh.ch/carbajal/


reply via email to

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