Re: octave error

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

 



On Wed, Apr 25, 2007 at 09:10:57AM -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?
> 
It's precedence has fooled you.  ^ has higher procedence than - so
what you have calculated is:-

    - ( 5 ^ 4 )


To get the answer you are expecting you need to type:-

    (-5)^4

-- 
Chris Green


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

  Powered by Linux