help-octave
[Top][All Lists]
Advanced

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

Re: plotting even function


From: Mike Miller
Subject: Re: plotting even function
Date: Sun, 20 Mar 2005 13:29:49 -0600 (CST)

On Sun, 20 Mar 2005, Geraint Paul Bevan wrote:

$ g++ a.cc && ./a.out
+1^2.0  1
- -1^2.0        1
+1^0.5  1
- -1^0.5        nan

As you can see from the results above, the double version of pow cannot cope with a negative base and non-integer exponent. Therefore in this case Octave uses the Complex (i.e. complex<double>) version of pow. It is this routine which is finding complex solutions for negative x instead of the real root that would be required for symmetry about the y-axis.


That's a very complete answer!  Thanks.

Mike



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]