[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fails
From: |
Mike Miller |
Subject: |
[Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fails |
Date: |
Sun, 01 May 2016 14:58:15 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0 |
Follow-up Comment #15, bug #47775 (project octave):
Octave already has special code in the xpow functions for integer exponents,
the point is that old versions of gcc is not doing the right thing, and how
much do we care about that when it's already been fixed in gcc 5.
With gcc 4.8:
$ cat cplxtest.cc
#include <complex>
#include <iostream>
int main (int argc, char *argv[])
{
std::complex<double> x (0, 1);
int y = 2;
std::cout << std::pow (x, y) << std::endl;
}
$ g++ cplxtest.cc -o cplxtest
$ ./cplxtest
(-1,0)
$ g++ -std=gnu++11 cplxtest.cc -o cplxtest
$ ./cplxtest
(-1,1.22465e-16)
With gcc 5:
$ g++ cplxtest.cc -o cplxtest
$ ./cplxtest
(-1,0)
$ g++ -std=gnu++11 cplxtest.cc -o cplxtest
$ ./cplxtest
(-1,0)
This is clearly a bug in gcc through version 4.8, I understand that this
breaks the realpow function, not just a failing unit test, so I'm not sure
what we should do about this. We could add more configure tests, and disable
the C++11 flags automatically on compilers that have this bug. This would add
more maintenance cost with conditionals for things like std::unique_ptr vs
std::auto_ptr.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?47775>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fails, Lachlan Andrew, 2016/05/01
- [Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fails,
Mike Miller <=
- [Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fail with gcc 4, Mike Miller, 2016/05/01
- [Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fail with C++11 and gcc 4, Mike Miller, 2016/05/01
- [Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fail with C++11 and gcc 4, Lachlan Andrew, 2016/05/01
- [Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fail with C++11 and gcc 4, anonymous, 2016/05/03
- [Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fail with C++11 and gcc 4, Lachlan Andrew, 2016/05/03
- [Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fail with C++11 and gcc 4, Mike Miller, 2016/05/03
- [Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fail with C++11 and gcc < 4.9.2, Rik, 2016/05/03
- [Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fail with C++11 and gcc < 4.9.2, Mike Miller, 2016/05/03
- [Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fail with C++11 and gcc < 4.9.2, Rik, 2016/05/03
- [Octave-bug-tracker] [bug #47775] realpow and sparse-xpow.cc-tst fail with C++11 and gcc < 4.9.2, Mike Miller, 2016/05/03