* Bug 15431 fixed [doc]: empty [] better documented
[scilab.git] / scilab / modules / integer / help / ru_RU / 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" version="5.0-subset Scilab"
20         xml:lang="ru" xml:id="iconvert">
21     <refnamediv>
22         <refname>iconvert</refname>
23         <refpurpose>преобразование в 1- или 8-байтное представление целого числа</refpurpose>
24     </refnamediv>
25     <refsynopsisdiv>
26         <title>Синтаксис</title>
27         <synopsis>y = iconvert(X, itype)</synopsis>
28     </refsynopsisdiv>
29     <refsection>
30         <title>Аргументы</title>
31         <variablelist>
32             <varlistentry>
33                 <term>X</term>
34                 <listitem>
35                     <para> матрица десятичных чисел или кодированных целых чисел.
36                       Комплексные числа не поддерживаются.
37                     </para>
38                 </listitem>
39             </varlistentry>
40             <varlistentry>
41                 <term>itype</term>
42                 <listitem>
43                     <para>целое число, тип преобразования.</para>
44                 </listitem>
45             </varlistentry>
46             <varlistentry>
47                 <term>y</term>
48                 <listitem>
49                     <para>матрица целых чисел, закодированных в 1, 2, 4 или 8 байтах.</para>
50                 </listitem>
51             </varlistentry>
52         </variablelist>
53     </refsection>
54     <refsection>
55         <title>Описание</title>
56         <para>
57             Функция <function>iconvert</function> преобразует и хранит данные в виде 1-,
58             2-, 4- или 8-байтных целых чисел.
59             Please refer to the <link linkend="int8">int8()</link> page for a detailled description.
60         </para>
61         <para>
62             <table>
63                 <tr><th>itype</th><th>y typeof</th> <th>range</th></tr>
64                 <tr><th>0</th>  <td>(reals)</td>    <td></td></tr>
65                 <tr><th>1</th>  <td>int8</td>   <td>[-128, 127]</td></tr>
66                 <tr><th>2</th>  <td>int16</td>  <td>[-32768, 32767]</td></tr>
67                 <tr><th>4</th>  <td>int32</td>  <td>[-2147483648, 2147483647]</td></tr>
68                 <tr><th>8</th>  <td>int64</td>  <td>[-9223372036854775808, 9223372036854775807]</td></tr>
69                 <tr><th>11</th> <td>uint8</td>  <td>[0, 255]</td></tr>
70                 <tr><th>12</th> <td>uint16</td> <td>[0, 65535]</td></tr>
71                 <tr><th>14</th> <td>uint32</td> <td>[0, 4294967295]</td></tr>
72                 <tr><th>18</th> <td>uint64</td> <td>[0, 18446744073709551615]</td></tr>
73             </table>
74         </para>
75         <warning>
76             Converting <literal>[]</literal> always keeps it as is, of type 1 == inttype 0
77            (decimal type).
78         </warning>
79     </refsection>
80     <refsection>
81         <title>Примеры</title>
82         <programlisting role="example"><![CDATA[
83 b = int32([1 -120 127 312])
84 y = iconvert(b,1)
85
86 typeof(b)
87 typeof(y)
88  ]]></programlisting>
89     <para/>
90     <programlisting role="example"><![CDATA[
91 iconvert([-3.6 -2.5 -1.2 1.2 2.5 3.6], 1)
92 iconvert([-%inf %inf %nan], 1)
93 iconvert([-%inf %inf %nan], 11)
94 iconvert(-1, 11)
95 iconvert(-1, 12)
96 iconvert(-1, 14)
97 iconvert(-1, 18)
98  ]]></programlisting>
99     <screen><![CDATA[
100 --> iconvert([-3.6 -2.5 -1.2 1.2 2.5 3.6], 1)
101  ans  =
102  -3 -2 -1  1  2  3
103
104 --> iconvert([-%inf %inf %nan], 1)
105  ans  =
106  -128  127  0
107
108 --> iconvert([-%inf %inf %nan], 11)
109  ans  =
110   0  255  0
111
112 --> iconvert(-1, 11)
113  ans  =
114   255
115
116 --> iconvert(-1, 12)
117  ans  =
118   65535
119
120 --> iconvert(-1, 14)
121  ans  =
122   4294967295
123
124 --> iconvert(-1, 18)
125  ans  =
126   18446744073709551615
127 ]]></screen>
128     </refsection>
129     <refsection role="see also">
130         <title>Смотрите также</title>
131         <simplelist type="inline">
132             <member>
133                 <link linkend="int8">int8</link>
134             </member>
135             <member>
136                 <link linkend="inttype">inttype</link>
137             </member>
138             <member>
139                 <link linkend="double">double</link>
140             </member>
141             <member>
142                 <link linkend="dec2bin">dec2bin</link>
143             </member>
144             <member>
145                 <link linkend="dec2base">dec2base</link>
146             </member>
147         </simplelist>
148     </refsection>
149     <refsection role="history">
150         <title>История</title>
151         <revhistory>
152             <revision>
153                 <revnumber>6.0</revnumber>
154                 <revdescription>
155                     <itemizedlist>
156                         <listitem>
157                             Support to int64 and uint64 encodings added.
158                         </listitem>
159                         <listitem>
160                             <table>
161                                 <tr><th>This</th>              <th>is now</th>     <th>instead of</th></tr>
162                                 <tr><td>iconvert([-%inf,%inf], 1)</td><td>[-128, 127]</td><td>[0, 0]</td></tr>
163                                 <tr><td>iconvert([-%inf,%inf], 2)</td><td>[-32768, 32767]</td><td>[0, 0]</td></tr>
164                                 <tr><td>iconvert(%inf, 4)</td>  <td>2147483647</td> <td>-2147483648</td></tr>
165                                 <tr><td>iconvert(%inf, 11)</td> <td>255</td>        <td>0</td></tr>
166                                 <tr><td>iconvert(%inf, 12)</td> <td>65535</td>      <td>0</td></tr>
167                                 <tr><td>iconvert(%inf, 14)</td> <td>4294967295</td> <td>0</td></tr>
168                             </table>
169                         </listitem>
170                     </itemizedlist>
171                 </revdescription>
172             </revision>
173         </revhistory>
174     </refsection>
175 </refentry>
176