octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #43728] rounding error for integer range multi


From: Michael Godfrey
Subject: [Octave-bug-tracker] [bug #43728] rounding error for integer range multiplied with floating point
Date: Sun, 30 Nov 2014 11:32:30 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0

Follow-up Comment #1, bug #43728 (project octave):

Well, it is not just starting with negative index since:
octave:47> mx=(-1:2)*0.1
mx =

   -0.100000000000000    0.000000000000000    0.100000000000000   
0.200000000000000

octave:48> mx(4)==0.2
ans =  1

but:
octave:49> mx=(-1:3)*0.1
mx =

 Columns 1 through 4:

   -0.100000000000000    0.000000000000000    0.100000000000000   
0.200000000000000

 Column 5:

    0.300000000000000

octave:50> mx(4)==0.2
ans = 0
And, of course:
octave:51> mx=(0:4)*0.1
mx =

 Columns 1 through 4:

    0.000000000000000    0.100000000000000    0.200000000000000   
0.300000000000000

 Column 5:

    0.400000000000000

octave:52> mx(3)==0.2
ans =  1


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43728>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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