diff doc/interpreter/expr.txi @ 14169:c0ca47ab7641 stable

doc: Better explain which complex result is chosen by .^ * expr.txi: Explain which complex root is chosen and how to choose a real one if preferred. * data.cc (power): Ditto. * help.cc (.^, .**): Ditto. (^, **): Suggest using real-valued functions.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Sun, 08 Jan 2012 15:24:53 -0500
parents f1ff06a1d73a
children 2ced2f59f523
line wrap: on
line diff
--- a/doc/interpreter/expr.txi	Sat Jan 07 12:44:34 2012 -0500
+++ b/doc/interpreter/expr.txi	Sun Jan 08 15:24:53 2012 -0500
@@ -603,7 +603,11 @@
 @opindex .^
 Element by element power operator. If both operands are matrices, the
 number of rows and columns must both agree, or they must be
-broadcastable to the same shape.
+broadcastable to the same shape. If several complex results are
+possible, the one with smallest nonnegative argument (angle) is taken.
+This may mean a complex root even if a real root is also possible. Use
+@code{realpow}, @code{realsqrt}, @code{cbrt}, or @code{nthroot} if a
+real result is preferred.
 
 @item -@var{x}
 @opindex -