d018f111d2c9fe1be42bd57c6a9b648ec40af10d
[scilab.git] / scilab / modules / elementary_functions / help / ja_JP / integer_representation / dec2bin.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!--
4  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
5  * Copyright (C) 2008 - INRIA
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
18 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="dec2bin" xml:lang="ja">
19
20     <refnamediv>
21
22         <refname>dec2bin</refname>
23
24         <refpurpose>10進数から2進数への変換</refpurpose>
25
26     </refnamediv>
27
28     <refsynopsisdiv>
29
30         <title>呼び出し手順</title>
31
32         <synopsis>
33
34             str=dec2bin(x)
35
36             str=dec2bin(x,n)
37
38         </synopsis>
39
40     </refsynopsisdiv>
41
42     <refsection>
43
44         <title>引数</title>
45
46         <variablelist>
47
48             <varlistentry>
49
50                 <term>x</term>
51
52                 <listitem>
53
54                     <para>double行列, 正の整数値</para>
55
56                 </listitem>
57
58             </varlistentry>
59
60             <varlistentry>
61
62                 <term>n</term>
63
64                 <listitem>
65
66                     <para>正の整数</para>
67
68                 </listitem>
69
70             </varlistentry>
71
72             <varlistentry>
73
74                 <term>str</term>
75
76                 <listitem>
77
78                     <para>文字列の行列</para>
79
80                 </listitem>
81
82             </varlistentry>
83
84         </variablelist>
85
86     </refsection>
87
88     <refsection>
89
90         <title>説明</title>
91
92         <para>
93
94             正の整数(または整数のベクトル/行列)
95
96             <literal>x</literal>を指定すると,
97
98             この関数は,
99
100             <literal>x</literal>の2進数表現を含む
101
102             文字列(または文字列の列ベクトル)を返します.
103
104             <literal>x</literal>の次元が1より大きい場合,
105
106             列ベクトル<literal>str</literal>の各要素が
107
108             <literal>x</literal>の要素の2進表現となります
109
110             (すなわち,<literal>str(i)</literal>が
111
112             <literal>x(i)</literal>の2進表現).
113
114         </para>
115
116         <para>
117
118             <literal>str</literal>の要素の長さが<literal>n</literal>
119
120             より小さい場合 (すなわち, length str(i) &lt; n),
121
122             <literal>str</literal>要素の左側に,長さが
123
124             <literal>n.</literal>等しくなる分の文字 '0'を
125
126             <literal>str</literal>要素の左側に追加します.
127
128         </para>
129
130     </refsection>
131
132     <refsection>
133
134         <title>例</title>
135
136         <programlisting role="example"><![CDATA[
137 // 例 1 :
138 x=86;
139 str=dec2bin(x)
140 // 例 2 :
141 // 86 の2進表現は : '1010110'
142 // 長さは7 (n以下)のため, str(の左側)に'0'が8個追加されます
143 x=86;n=15;
144 str=dec2bin(x,n)
145 // 例 3 :
146 x=[12;45;135]
147 z=dec2bin(x)
148  ]]></programlisting>
149
150     </refsection>
151
152     <refsection role="see also">
153
154         <title>参照</title>
155
156         <simplelist type="inline">
157
158             <member>
159
160                 <link linkend="base2dec">base2dec</link>
161
162             </member>
163
164             <member>
165
166                 <link linkend="bin2dec">bin2dec</link>
167
168             </member>
169
170             <member>
171
172                 <link linkend="oct2dec">oct2dec</link>
173
174             </member>
175
176             <member>
177
178                 <link linkend="hex2dec">hex2dec</link>
179
180             </member>
181
182             <member>
183
184                 <link linkend="dec2oct">dec2oct</link>
185
186             </member>
187
188             <member>
189
190                 <link linkend="dec2hex">dec2hex</link>
191
192             </member>
193
194         </simplelist>
195
196     </refsection>
197
198 </refentry>
199