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

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

[Octave-bug-tracker] [bug #51282] Column vector and equality operator ar


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #51282] Column vector and equality operator are not playing nice together.
Date: Tue, 20 Jun 2017 22:42:15 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0

Follow-up Comment #3, bug #51282 (project octave):

What you want to ask Octave for is


d = (-10:10)./10;


What you are asking Octave for is to add multiples of 0.1 to a starting value
of -1 until it hits +1.

If you do understand floating point representation, which jwe provided a
pointer for, then you'll know why the following relationship returns false:


>> -1 + 0.1 * 6
ans = -0.40000
>> -1 + 0.1 * 6 == -0.4
ans = 0


That should be enough to explain why the computed range you asked for is
behaving the way it is.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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