Wed 21 Jun 2017 01:19:09 AM UTC, comment #2:
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.
|