Re: octave error

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

 



On Wed, 2007-04-25 at 09:10 -0300, Martin Marques wrote:
> Please, tell me I haven't lost it yet.
> 
> octave:14> -5^4
> ans = -625
> 
> Since when does an even power of a negative number give a negative result?
> 
> $ rpm -q octave
> octave-2.9.9-1.fc6
In many math programs a -# means to multiply the digits by (-1).  Since
exponentiation is a higher math precidence (unary operator vs binary
operator), exponentiation occurs first, then the multiply.  Try (-5)^4.

Regards,
Les H


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux