Add a warning about associativity.
[scilab.git] / scilab / modules / m2sci / help / en_US / m2sci_equivalents / operators / power.xml
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2009 - DIGITEO - Vincent COUVERT
5  *
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at
10  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
11  *
12  -->
13 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="m2sci_power">
14     <refnamediv>
15         <refname>^ (Matlab operator)</refname>
16         <refpurpose>Exponent</refpurpose>
17     </refnamediv>
18     <refsection>
19         <title>Matlab/Scilab equivalent</title>
20         <informaltable border="1" width="100%">
21             <tr>
22                 <td align="center">
23                     <emphasis role="bold">Matlab</emphasis>
24                 </td>
25                 <td align="center">
26                     <emphasis role="bold">Scilab</emphasis>
27                 </td>
28             </tr>
29             <tr>
30                 <td>
31                     <programlisting role="example"><![CDATA[
32 ^
33 ]]></programlisting>
34                 </td>
35                 <td>
36                     <programlisting role="example"><![CDATA[
37 ^
38 ]]></programlisting>
39                 </td>
40             </tr>
41         </informaltable>
42     </refsection>
43     <refsection>
44         <title>Particular cases</title>
45         <para>
46             <note>
47                 Note that Matlab seems to have a bug for <emphasis role="bold">X^(Y)</emphasis> when <emphasis role="bold">X</emphasis> is a character and that in Scilab operations such as <emphasis role="bold">X^(Y)</emphasis> with <emphasis role="bold">X</emphasis> a scalar and <emphasis role="bold">Y</emphasis> a matrix is equivalent to <emphasis role="bold">X.^(Y)</emphasis> (Will change in next Scilab versions...).
48             </note>
49         </para>
50         <para>
51             <warning>
52                 Exponentiation is right-associative in Scilab contrarily to Matlab&#174; and Octave. For example 2^3^4 is equal to 2^(3^4) in Scilab but is equal to (2^3)^4 in Matlab&#174; and Octave.
53             </warning>
54         </para>
55     </refsection>
56 </refentry>