Fractional powers of negative numbers giving NaN

Thomas Weber thomas.weber.mail at gmail.com
Wed Mar 25 15:59:32 CDT 2009


On Wed, Mar 25, 2009 at 02:19:17PM +0100, Marco Caliari wrote:
> 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)

Are you sure about the compiler versions? GCC 3.3.3 was released in
2004.

Anyway, I'd recommend a newer compiler.

	Thomas


More information about the Bug-octave mailing list