47f8421c192a053459db69e43dacfd1e7ca6020b
[scilab.git] / scilab / modules / integer / help / en_US / iconvert.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) 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" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="en" xml:id="iconvert">
17     <refnamediv>
18         <refname>iconvert</refname>
19         <refpurpose> conversion to 1 or 4 byte integer representation</refpurpose>
20     </refnamediv>
21     <refsynopsisdiv>
22         <title>Syntax</title>
23         <synopsis>y = iconvert(X, itype)</synopsis>
24     </refsynopsisdiv>
25     <refsection>
26         <title>Arguments</title>
27         <variablelist>
28             <varlistentry>
29                 <term>X</term>
30                 <listitem>
31                     <para>a matrix of floats or integers.</para>
32                 </listitem>
33             </varlistentry>
34             <varlistentry>
35                 <term>itype</term>
36                 <listitem>
37                     <para>an integer, a type of conversion.</para>
38                 </listitem>
39             </varlistentry>
40             <varlistentry>
41                 <term>y</term>
42                 <listitem>
43                     <para>a matrix of integers coded on one, two or four bytes.</para>
44                 </listitem>
45             </varlistentry>
46         </variablelist>
47     </refsection>
48     <refsection>
49         <title>Description</title>
50         <para>
51             The <function>iconvert</function> function converts and stores data to one, two or four bytes integers.
52         </para>
53         <variablelist>
54             <varlistentry>
55                 <term>itype = 0</term>
56                 <listitem>
57                     <para>return floating point numbers</para>
58                 </listitem>
59             </varlistentry>
60             <varlistentry>
61                 <term>itype = 1</term>
62                 <listitem>
63                     <para>
64                         return <literal>int8</literal> numbers in the range <literal>[-128, 127]</literal>
65                     </para>
66                 </listitem>
67             </varlistentry>
68             <varlistentry>
69                 <term>itype = 11</term>
70                 <listitem>
71                     <para>
72                         return <literal>uint8</literal> numbers in the range <literal>[0, 255]</literal>
73                     </para>
74                 </listitem>
75             </varlistentry>
76             <varlistentry>
77                 <term>itype = 2</term>
78                 <listitem>
79                     <para>
80                         return <literal>int16</literal> numbers in the range <literal>[-32768, 32767]</literal>
81                     </para>
82                 </listitem>
83             </varlistentry>
84             <varlistentry>
85                 <term>itype = 12</term>
86                 <listitem>
87                     <para>
88                         return <literal>uint16</literal> numbers in the range <literal>[0, 65535]</literal>
89                     </para>
90                 </listitem>
91             </varlistentry>
92             <varlistentry>
93                 <term>itype = 4</term>
94                 <listitem>
95                     <para>
96                         return <literal>int32</literal> numbers in the range <literal>[-2147483648, 2147483647]</literal>
97                     </para>
98                 </listitem>
99             </varlistentry>
100             <varlistentry>
101                 <term>itype = 14</term>
102                 <listitem>
103                     <para>
104                         return <literal>uint32</literal> numbers in the range <literal>[0, 4294967295]</literal>
105                     </para>
106                 </listitem>
107             </varlistentry>
108         </variablelist>
109     </refsection>
110     <refsection>
111         <title>Examples</title>
112         <programlisting role="example"><![CDATA[ 
113 b=int32([1 -120 127 312])
114 y=iconvert(b,1)
115
116 typeof(b)
117 typeof(y)
118  ]]></programlisting>
119     </refsection>
120     <refsection role="see also">
121         <title>See Also</title>
122         <simplelist type="inline">
123             <member>
124                 <link linkend="double">double</link>
125             </member>
126             <member>
127                 <link linkend="int8">int8</link>
128             </member>
129             <member>
130                 <link linkend="inttype">inttype</link>
131             </member>
132         </simplelist>
133     </refsection>
134 </refentry>