[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #54302] power operator: 0.^0 results in NaN in
From: |
Dan Sebald |
Subject: |
[Octave-bug-tracker] [bug #54302] power operator: 0.^0 results in NaN in some case |
Date: |
Sun, 15 Jul 2018 23:44:35 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0 |
Follow-up Comment #6, bug #54302 (project octave):
I was just thinking back, regarding the
xpow (const Complex& a, double b)
{
- Complex result;
-
- if (xisint (b))
- result = std::pow (a, static_cast<int> (b));
that I removed in the patch, is it possibly the case that at one time these
routines used
result = pow (a, static_cast<int> (b));
and that was supposed to find the version of pow() I listed in the previous
post, originating from oct-inttypes.cc? That integer version might be
slightly more accurate than std::pow(), but possibly a little slower...not
drastically slow because it does use a fairly fast reduction by squaring the
running product and bit-shifting b. I would imagine that std::pow() is using
logarithms or something similar to turn power into multiplication.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?54302>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/