bitstring() complement
[scilab.git] / scilab / modules / elementary_functions / help / ja_JP / integer_representation / dec2bin.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) 2008 - 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"
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="dec2bin" xml:lang="ja">
20     <refnamediv>
21         <refname>dec2bin</refname>
22         <refpurpose>10進数から2進数への変換</refpurpose>
23     </refnamediv>
24     <refsynopsisdiv>
25         <title>呼び出し手順</title>
26         <synopsis>
27             str = dec2bin(x)
28             str = dec2bin(x,n)
29         </synopsis>
30     </refsynopsisdiv>
31     <refsection>
32         <title>引数</title>
33         <variablelist>
34             <varlistentry>
35                 <term>x</term>
36                 <listitem>
37                     <para>double行列, 正の整数値</para>
38                 </listitem>
39             </varlistentry>
40             <varlistentry>
41                 <term>n</term>
42                 <listitem>
43                     <para>正の整数</para>
44                 </listitem>
45             </varlistentry>
46             <varlistentry>
47                 <term>str</term>
48                 <listitem>
49                     <para>文字列の行列</para>
50                 </listitem>
51             </varlistentry>
52         </variablelist>
53     </refsection>
54     <refsection>
55         <title>説明</title>
56         <para>
57             正の整数(または整数のベクトル/行列)
58             <literal>x</literal>を指定すると,
59             この関数は,
60             <literal>x</literal>の2進数表現を含む
61             文字列(または文字列の列ベクトル)を返します.
62             <literal>x</literal>の次元が1より大きい場合,
63             列ベクトル<literal>str</literal>の各要素が
64             <literal>x</literal>の要素の2進表現となります
65             (すなわち,<literal>str(i)</literal>が
66             <literal>x(i)</literal>の2進表現).
67         </para>
68         <para>
69             <literal>str</literal>の要素の長さが<literal>n</literal>
70             より小さい場合 (すなわち, length str(i) &lt; n),
71             <literal>str</literal>要素の左側に,長さが
72             <literal>n.</literal>等しくなる分の文字 '0'を
73             <literal>str</literal>要素の左側に追加します.
74         </para>
75     </refsection>
76     <refsection>
77         <title>例</title>
78         <programlisting role="example"><![CDATA[
79 // 例 1 :
80 x=86;
81 str=dec2bin(x)
82
83 // 例 2 :
84 // 86 の2進表現は : '1010110'
85 // 長さは7 (n以下)のため, str(の左側)に'0'が8個追加されます
86 x=86;n=15;
87 str=dec2bin(x,n)
88
89 // 例 3 :
90 x=[12;45;135]
91 z=dec2bin(x)
92  ]]></programlisting>
93     </refsection>
94     <refsection role="see also">
95         <title>参照</title>
96         <simplelist type="inline">
97             <member>
98                 <link linkend="bitstring">bitstring</link>
99             </member>
100             <member>
101                 <link linkend="dec2base">dec2base</link>
102             </member>
103             <member>
104                 <link linkend="dec2oct">dec2oct</link>
105             </member>
106             <member>
107                 <link linkend="dec2hex">dec2hex</link>
108             </member>
109             <member>
110                 <link linkend="bin2dec">bin2dec</link>
111             </member>
112         </simplelist>
113     </refsection>
114 </refentry>