octave-maintainers
[Top][All Lists]
Advanced

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

Re: A problem with range objects and floating point numbers


From: s.jo
Subject: Re: A problem with range objects and floating point numbers
Date: Mon, 22 Sep 2014 18:27:51 -0700 (PDT)

John W. Eaton wrote
> On 06/20/2014 04:28 PM, Julien Bect wrote:
>> Hello all,
>>
>> I would like to bring the following bug report to your attention :
>>
>> http://savannah.gnu.org/bugs/?42589
>>
>> A simple example of the regression described in this report is the
>> following :
>>
>>      octave:1> (9:10) * .1 - 1
>>      ans =
>>
>>         -1.0000e-01    2.7756e-17
>>
>> The second element should be 0.
>>
>> Rik thinks that this bug might be hard to solve... which is why I'm
>> bringing this up on this list :)
> 
> Please see my comments on the bug tracker.
> 
> jwe

I have the similar problem with octave 3.8.1 on cygwin.
See below:
octave:50> t=[-2:0.1:0]
t =

 Columns 1 through 5:

                    -2                  -1.9                  -1.8              
   
-1.7                  -1.6

 Columns 6 through 10:

                  -1.5                  -1.4                  -1.3              
   
-1.2                  -1.1

 Columns 11 through 15:

                    -1                  -0.9                  -0.8              
   
-0.7                  -0.6

 Columns 16 through 20:

                  -0.5                  -0.4                  -0.3              
   
-0.2   -0.0999999999999999

 Column 21:

                     0

Range command is not good with floating-point step only starting from
negative integer as above.

I am trying to upgrade octave 3.8.2 to see if this problem is fixed.

I post it just in case.

Thank you.

--jo




--
View this message in context: 
http://octave.1599824.n4.nabble.com/A-problem-with-range-objects-and-floating-point-numbers-tp4664900p4666643.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.



reply via email to

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