<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; JS:перевод числа в двоичный формат]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8496&amp;type=atom" />
	<updated>2013-07-20T19:39:04Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=8496</id>
		<entry>
			<title type="html"><![CDATA[Re: JS:перевод числа в двоичный формат]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=73946#p73946" />
			<content type="html"><![CDATA[<p>то что надо! спасибо.</p>]]></content>
			<author>
				<name><![CDATA[im2002]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28063</uri>
			</author>
			<updated>2013-07-20T19:39:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=73946#p73946</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: JS:перевод числа в двоичный формат]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=73943#p73943" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>
var numb = /* какое-то число */;
var str = numb.toString(2);
</code></pre></div><div class="codebox"><pre><code>
var numb = 1234567890;
var str = numb.toString(2);
if(str == &quot;1001001100101100000001011010010&quot;)
{
   /* true */
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[max7]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=10498</uri>
			</author>
			<updated>2013-07-20T19:33:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=73943#p73943</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[JS:перевод числа в двоичный формат]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=73942#p73942" />
			<content type="html"><![CDATA[<p>понадобилась ф-я для перевода десятичных чисел в двоичный формат.<br />я написал,&nbsp; работает, но уж очень &quot;корявый&quot; код получился... подскажите как &quot;поизящнее&quot; сделать...</p><div class="codebox"><pre><code>function Conv(n)                    
    {
    var numb = n, str = &quot;&quot;, $str = &quot;&quot;;
    Conv$(numb);
    function Conv$(numb)
        {
        dec = parseInt(numb/2);            // получение целой части от деления
        ost = numb%2;                // получение остатка от деления
        while((dec != 0) || (ost != 1))
            {
            str += ost;
            Conv$(dec);
            }
        rez = str + &quot;1&quot;;
        return rez;
        }
    for(var k = rez.length; k &gt;= 0; k--)
        {
        $str += rez.charAt(k);
        }
    return $str;
    }</code></pre></div>]]></content>
			<author>
				<name><![CDATA[im2002]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28063</uri>
			</author>
			<updated>2013-07-20T19:10:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=73942#p73942</id>
		</entry>
</feed>
