[doc] misc. patchs & small improvements
[scilab.git] / scilab / modules / elementary_functions / help / en_US / discrete / primes.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2008 - INRIA
5  *
6  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  -->
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17           xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
18           xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
19           xmlns:scilab="http://www.scilab.org" xml:id="primes" xml:lang="en">
20     <refnamediv>
21         <refname>primes</refname>
22         <refpurpose>lists of primes up to a given number</refpurpose>
23     </refnamediv>
24     <refsynopsisdiv>
25         <title>Syntax</title>
26         <synopsis>y = primes(x)</synopsis>
27     </refsynopsisdiv>
28     <refsection>
29         <title>Arguments</title>
30         <variablelist>
31             <varlistentry>
32                 <term>x</term>
33                 <listitem>
34                     <para>real scalar</para>
35                 </listitem>
36             </varlistentry>
37             <varlistentry>
38                 <term>y</term>
39                 <listitem>
40                     <para>vector</para>
41                 </listitem>
42             </varlistentry>
43         </variablelist>
44     </refsection>
45     <refsection>
46         <title>Description</title>
47         <para>
48             Given a real <literal>x</literal>, <literal>primes(x)</literal>
49             returns in a vector <literal>y</literal> all the prime numbers in
50             <literal>[2, x]</literal>. If <literal>x&lt;2</literal> then
51             <literal>primes(x)</literal> returns an empty matrix.
52         </para>
53     </refsection>
54     <refsection>
55         <title>Examples</title>
56         <programlisting role="example"><![CDATA[
57 primes(35)
58      ]]></programlisting>
59     <screen><![CDATA[
60 --> primes(35)
61  ans  =
62    2.   3.   5.   7.   11.   13.   17.   19.   23.   29.   31.
63 ]]></screen>
64     </refsection>
65     <refsection role="see also">
66         <title>See also</title>
67         <simplelist type="inline">
68             <member>
69                 <link linkend="factor">factor</link>
70             </member>
71         </simplelist>
72     </refsection>
73 </refentry>