help-octave
[Top][All Lists]
Advanced

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

Re: How to print this function?


From: Przemek Klosowski
Subject: Re: How to print this function?
Date: Tue, 22 May 2012 16:27:52 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

On 05/22/2012 03:27 PM, marco atzeri wrote:
On 5/22/2012 8:26 PM, Sergei Steshenko wrote:


Though not related to your original question, 0.1 may be a periodic fraction in 
your _binary_ CPU, so you better write


t = 0.1 * [-10:1:10];


irrilevant in this case

octave:4>  [-1:0.1:1;]-0.1*[-10:1:10;]<eps
<... shows that the differences are all less than eps ...>

Well, the point of 'eps' is that it is the smallest normalized number so it masks the simple roundoff errors. In this case you haven't accumulated enough of roundoff to exceed eps, but if you keep going you eventually will. A quick try shows that you need four orders of magnitude more operations:

min([-1:0.00001:1;]-0.00001*[-100000:1:100000;]<eps)

Sergei showed you the correct form that will never fail.


reply via email to

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