[doc] misc fix & improvements
[scilab.git] / scilab / modules / core / help / en_US / 1_keywords / percent.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
3           xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
4           xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
5           xml:lang="en" xml:id="percent">
6     <refnamediv>
7         <refname>percent</refname>
8         <refpurpose>(%) special character</refpurpose>
9     </refnamediv>
10     <refsection>
11         <title>Description</title>
12         <para>
13             Some predefined variables names begin with <literal>%</literal>, such as
14             <literal>%i</literal> (for <literal>sqrt(-1)</literal>), <literal>%inf</literal>
15             (for <literal>Infinity</literal>), <literal>%pi</literal> (for <literal>3.14...</literal>),
16             <literal>%T</literal> (for the boolean constant <literal>"true"</literal>),...
17         </para>
18         <para>
19             In addition, functions whose names begin with <literal>%</literal> are special :
20             they are used for primitives and operators overloading.
21         </para>
22         <para>
23             For example the function <literal>%r_m_r</literal> performs the multiplication
24             (<literal>m</literal>) operation <literal>x*y</literal> for <literal>x</literal> and
25             <literal>y</literal> rational matrices (<literal>r</literal>).
26             The coding conventions are described in the <link linkend="overloading">overloading</link>
27             help page.
28         </para>
29     </refsection>
30     <refsection>
31         <title>Examples</title>
32         <programlisting role="example"><![CDATA[
33 x1 = tlist('x',1,2);
34 x2 = tlist('x',2,3);
35 deff('x = %x_m_x(x1,x2)','x = list(''x'', x1(2)*x2(2), x2(3)*x2(3))');
36 x1 * x2
37  ]]></programlisting>
38     </refsection>
39     <refsection role="see also">
40         <title>See also</title>
41         <simplelist type="inline">
42             <member>
43                 <link linkend="overloading">overloading</link>
44             </member>
45             <member>
46                 <link linkend="names">names</link>
47             </member>
48             <member>
49                 <link linkend="symbols">symbols</link>
50             </member>
51             <member>
52                 <link linkend="printf_conversion">printf_conversion</link>
53             </member>
54         </simplelist>
55     </refsection>
56 </refentry>