Fractional powers of negative numbers giving NaN

Marco Caliari marco.caliari at univr.it
Wed Mar 25 08:19:17 CDT 2009


Dear all,

I'm writing to this mailing list, although maybe the problem is not 
related to Octave but to libraries/compilers. With Octave 3.0.x, I 
get

octave:1> sqrt(-1)
ans =  0 + 1i
octave:2> (-1)^(1/2)
ans = NaN
octave:3>

Machine specifications:

AMD Opteron(tm) Processor 248
gcc (GCC) 3.3.3 (SuSE Linux)
GNU Fortran (GCC) 3.3.3 (SuSE Linux)
g++ (GCC) 3.3.3 (SuSE Linux)

ACML 3.6.0 gnu64

Octave was compiled with

CFLAGS='-O3 -m64 -fPIC'
FFLAGS='-O3 -m64 -fPIC'
CXXFLAGS='-O3 -m64 -fPIC'

I would appreciate any hint.

Best regards,

Marco


More information about the Bug-octave mailing list