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: N Howard
Subject: [Octave-bug-tracker] [bug #51282] Column vector and equality operator are not playing nice together.
Date: Tue, 20 Jun 2017 21:19:09 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

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

Thank you for the quick reply.  Perhaps we can drill a little further with
this?  What I'm looking for is:

d = (-1:.1:1);

that is, one decimal point of precision, but instead, it seems that Octave is
running far deeper than that.  For instance, if I were to do:

>> r = 0.3999999999999999
r =  0.400000000000000

then that would follow, but if I were to simply instead:

>> r = 0.399
r =  0.399000000000000
>> e = 0.399
e =  0.399000000000000
>> r == e
ans = 1

then life is happy again.  It appears as though d is generated in a manner
that doesn't honor my ask; if it would, then my simple equality would hold
without trouble.  For instance,

d_better = [-1 -.9 -.8 -.7 -.6 -.5 -.4 -.3 -.2 -.1 0 .1 .2 .3 .4 .5 .6 .7 .8
.9 1];

>> d_better == d
ans =

  1  1  1  1  1  1  0  0  0  0  0  0  0  0  0  0  0  0  1  0  1
  
but this should hold if d was generated as asked for; therefore, the generated
d is not a good representation of what was sought.

As far as I can tell, this would be a bug.

    _______________________________________________________

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]