Non-decimal radices/Convert: Difference between revisions

Content added Content deleted
(→‎{{header|Ruby}}: Since Ruby 1.9.3, Integer takes a second argument (base) and is strict (errors fast).)
m (→‎{{header|REXX}}: removed STYLE from PRE html tag.)
Line 1,752: Line 1,752:
ser: say; say '*** error! ***'; say; exit 13</lang>
ser: say; say '*** error! ***'; say; exit 13</lang>
'''output''' when input is (maximum positive integer in a signed 32-bit word): <tt> 7fffffff , 16 </tt>
'''output''' when input is (maximum positive integer in a signed 32-bit word): <tt> 7fffffff , 16 </tt>
<pre>
<pre style="overflow:scroll">
7fffffff (base 16) is 2147483647 (base 10)
7fffffff (base 16) is 2147483647 (base 10)
</pre>
</pre>
'''output''' when input is: <tt> 4095 2 </tt>
'''output''' when input is: <tt> 4095 2 </tt>
<pre>
<pre style="overflow:scroll">
4095 (base 10) is 111111111111 (base 2)
4095 (base 10) is 111111111111 (base 2)
</pre>
</pre>
'''output''' when input is: <tt> 100 3 2 </tt>
'''output''' when input is: <tt> 100 3 2 </tt>
<pre>
<pre style="overflow:scroll">
100 (base 2) is 11 (base 3)
100 (base 2) is 11 (base 3)
</pre>
</pre>
'''output''' when input is: <tt> zombieseatingdeadvegetables 10 36 </tt>
'''output''' when input is: <tt> zombieseatingdeadvegetables 10 36 </tt>
<pre>
<pre style="overflow:scroll">
zombieseatingdeadvegetables (base 36) is 1038334289300125869792154778345043071467300 (base 10)
zombieseatingdeadvegetables (base 36) is 1038334289300125869792154778345043071467300 (base 10)
</pre>
</pre>