* Bug 15431 fixed [doc]: empty [] better documented
[scilab.git] / scilab / modules / integer / help / fr_FR / 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  * Copyright (C) 2018 - Samuel GOUGEON
6  *
7  * Copyright (C) 2012 - 2016 - Scilab Enterprises
8  *
9  * This file is hereby licensed under the terms of the GNU GPL v2.0,
10  * pursuant to article 5.3.4 of the CeCILL v.2.1.
11  * This file was originally licensed under the terms of the CeCILL v2.1,
12  * and continues to be available under such terms.
13  * For more information, see the COPYING file which you should have received
14  * along with this program.
15  *
16  -->
17 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
18         xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
19         xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
20         xml:lang="fr" xml:id="iconvert">
21     <refnamediv>
22         <refname>iconvert </refname>
23         <refpurpose>conversion en entiers encodés sur 1, 2, 4 ou 8 octets</refpurpose>
24     </refnamediv>
25     <refsynopsisdiv>
26         <title>Séquence d'appel</title>
27         <synopsis>y = iconvert(X, itype)</synopsis>
28     </refsynopsisdiv>
29     <refsection>
30         <title>Arguments</title>
31         <variablelist>
32             <varlistentry>
33                 <term>X</term>
34                 <listitem>
35                     <para>
36                       matrice de nombres décimaux ou d'entiers encodés ou de booléens.
37                       Les nombres complexes ne sont pas acceptés.
38                     </para>
39                 </listitem>
40             </varlistentry>
41             <varlistentry>
42                 <term>y</term>
43                 <listitem>
44                     <para>
45                         matrice d'entiers encodés sur 1, 2, 4 ou 8 octets, de mêmes tailles que
46                         <varname>X</varname>.
47                     </para>
48                 </listitem>
49             </varlistentry>
50         </variablelist>
51     </refsection>
52     <refsection>
53         <title>Description</title>
54         <para>
55             Convertit et stocke sous forme d'entiers à 1, 2, 4 ou 8 octets. Pour plus d'information,
56             voir la page de <link linkend="int8">int8()</link>.
57         </para>
58         <para>
59             <table>
60                 <tr><th>itype</th><th>y typeof</th> <th>Résultat sur</th></tr>
61                 <tr><th>0</th>  <td>(décimaux)</td> <td></td></tr>
62                 <tr><th>1</th>  <td>int8</td>   <td>[-128, 127]</td></tr>
63                 <tr><th>2</th>  <td>int16</td>  <td>[-32768, 32767]</td></tr>
64                 <tr><th>4</th>  <td>int32</td>  <td>[-2147483648, 2147483647]</td></tr>
65                 <tr><th>8</th>  <td>int64</td>  <td>[-9223372036854775808, 9223372036854775807]</td></tr>
66                 <tr><th>11</th> <td>uint8</td>  <td>[0, 255]</td></tr>
67                 <tr><th>12</th> <td>uint16</td> <td>[0, 65535]</td></tr>
68                 <tr><th>14</th> <td>uint32</td> <td>[0, 4294967295]</td></tr>
69                 <tr><th>18</th> <td>uint64</td> <td>[0, 18446744073709551615]</td></tr>
70             </table>
71         </para>
72         <warning>
73             La conversion de <literal>[]</literal> ne change rien : son type 1 == inttype 0
74             est toujours conservé (type numérique décimal).
75         </warning>
76     </refsection>
77     <refsection>
78         <title>Exemples</title>
79         <programlisting role="example"><![CDATA[
80 b=int32([1 -120 127 312])
81 y=iconvert(b,1)
82  ]]></programlisting>
83     <para/>
84     <programlisting role="example"><![CDATA[
85 iconvert([-3.6 -2.5 -1.2 1.2 2.5 3.6], 1)
86 iconvert([-%inf %inf %nan], 1)
87 iconvert([-%inf %inf %nan], 11)
88 iconvert(-1, 11)
89 iconvert(-1, 12)
90 iconvert(-1, 14)
91 iconvert(-1, 18)
92  ]]></programlisting>
93     <screen><![CDATA[
94 --> iconvert([-3.6 -2.5 -1.2 1.2 2.5 3.6], 1)
95  ans  =
96  -3 -2 -1  1  2  3
97
98 --> iconvert([-%inf %inf %nan], 1)
99  ans  =
100  -128  127  0
101
102 --> iconvert([-%inf %inf %nan], 11)
103  ans  =
104   0  255  0
105
106 --> iconvert(-1, 11)
107  ans  =
108   255
109
110 --> iconvert(-1, 12)
111  ans  =
112   65535
113
114 --> iconvert(-1, 14)
115  ans  =
116   4294967295
117
118 --> iconvert(-1, 18)
119  ans  =
120   18446744073709551615
121 ]]></screen>
122     </refsection>
123     <refsection role="see also">
124         <title>Voir aussi</title>
125         <simplelist type="inline">
126             <member>
127                 <link linkend="int8">int8</link>
128             </member>
129             <member>
130                 <link linkend="inttype">inttype</link>
131             </member>
132             <member>
133                 <link linkend="double">double</link>
134             </member>
135             <member>
136                 <link linkend="dec2bin">dec2bin</link>
137             </member>
138             <member>
139                 <link linkend="dec2base">dec2base</link>
140             </member>
141         </simplelist>
142     </refsection>
143     <refsection role="history">
144         <title>Historique</title>
145         <revhistory>
146             <revision>
147                 <revnumber>6.0</revnumber>
148                 <revdescription>
149                     <itemizedlist>
150                         <listitem>
151                             Ajout des conversions depuis/en int64 and uint64.
152                         </listitem>
153                         <listitem>
154                             <table>
155                                 <tr><th>Ceci</th>              <th>vaut désormais</th>     <th>au lieu de</th></tr>
156                                 <tr><td>iconvert([-%inf,%inf], 1)</td><td>[-128, 127]</td><td>[0, 0]</td></tr>
157                                 <tr><td>iconvert([-%inf,%inf], 2)</td><td>[-32768, 32767]</td><td>[0, 0]</td></tr>
158                                 <tr><td>iconvert(%inf, 4)</td>  <td>2147483647</td> <td>-2147483648</td></tr>
159                                 <tr><td>iconvert(%inf, 11)</td> <td>255</td>        <td>0</td></tr>
160                                 <tr><td>iconvert(%inf, 12)</td> <td>65535</td>      <td>0</td></tr>
161                                 <tr><td>iconvert(%inf, 14)</td> <td>4294967295</td> <td>0</td></tr>
162                             </table>
163                         </listitem>
164                     </itemizedlist>
165                 </revdescription>
166             </revision>
167         </revhistory>
168     </refsection>
169 </refentry>