help-octave
[Top][All Lists]
Advanced

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

Re: single function


From: James Sherman Jr.
Subject: Re: single function
Date: Tue, 26 Jan 2010 14:06:00 -0500

I believe that is to be expected from single floating point precision.   (eps(single(1)) = 1.92e-7)  Because you're using single precision numbers, any calculations are only reliable up to +/- that number.  It has nothing to do with the function "single" but with floating point calculations.  The wikipedia article probably describes it better than I can.

http://en.wikipedia.org/wiki/Machine_epsilon

2010/1/26 Kuznetsov Roman <address@hidden>
I don't know is it normal but I've faced with this

    DATA="" href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/struct.html" target="_blank">struct("T",[-2:0.3:4]');
    #a little experiment
    octave:3> (DATA.T(2)-DATA.T(1))-(DATA.T(3)-DATA.T(2))
    ans = 0
    octave:4> DATA.T=single(DATA.T);
    octave:5> (DATA.T(2)-DATA.T(1))-(DATA.T(3)-DATA.T(2))
    ans = -1.1921e-07

So you can see that "single" function don't work correct.

_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave



reply via email to

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