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

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

[Octave-bug-tracker] [bug #43741] different results from power operator


From: Rik
Subject: [Octave-bug-tracker] [bug #43741] different results from power operator in mxe-octave GUI/CLI
Date: Wed, 01 Apr 2015 22:15:24 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:36.0) Gecko/20100101 Firefox/36.0

Follow-up Comment #12, bug #43741 (project octave):

@jwe: Maybe the reason we see it with the Qt libraries linked in is that there
is more register pressure on the compiler?

Here is another test case


octave:1> x = 1/10;
octave:2> x*x - 1/100
ans =    1.7347e-18
octave:3> 1/10 * 1/10 - 1/100
ans = 0


If I understand this correctly, storing 1/10 in a double loses some precision
so that 1/10 * 1/10 is no longer equal to 1/100.  On the other hand, executing
the calculation directly on the command line doesn't involve a register
truncation as the result is just calculated serially in an extended floating
point register.  Is that right?



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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