1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 2008 - INRIA
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
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.
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">
21 <refname>dec2bin</refname>
22 <refpurpose>10進数から2進数への変換</refpurpose>
37 <para>double行列, 正の整数値</para>
58 <literal>x</literal>を指定すると,
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進表現).
69 <literal>str</literal>の要素の長さが<literal>n</literal>
70 より小さい場合 (すなわち, length str(i) < n),
71 <literal>str</literal>要素の左側に,長さが
72 <literal>n.</literal>等しくなる分の文字 '0'を
73 <literal>str</literal>要素の左側に追加します.
78 <programlisting role="example"><![CDATA[
84 // 86 の2進表現は : '1010110'
85 // 長さは7 (n以下)のため, str(の左側)に'0'が8個追加されます
94 <refsection role="see also">
96 <simplelist type="inline">
98 <link linkend="bitstring">bitstring</link>
101 <link linkend="dec2base">dec2base</link>
104 <link linkend="dec2oct">dec2oct</link>
107 <link linkend="dec2hex">dec2hex</link>
110 <link linkend="bin2dec">bin2dec</link>