1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 2008 - INRIA
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
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.
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">
21 <refname>primes</refname>
22 <refpurpose>lists of primes up to a given number</refpurpose>
26 <synopsis>y = primes(x)</synopsis>
29 <title>Arguments</title>
34 <para>real scalar</para>
46 <title>Description</title>
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<2</literal> then
51 <literal>primes(x)</literal> returns an empty matrix.
55 <title>Examples</title>
56 <programlisting role="example"><![CDATA[
62 2. 3. 5. 7. 11. 13. 17. 19. 23. 29. 31.
65 <refsection role="see also">
66 <title>See also</title>
67 <simplelist type="inline">
69 <link linkend="factor">factor</link>