Non-decimal radices/Input: Difference between revisions
Content added Content deleted
m (Added the Sidef language) |
|||
Line 695: | Line 695: | ||
say :35($n); # -> 1543536 |
say :35($n); # -> 1543536 |
||
say :36($n); # -> 1726309</lang> |
say :36($n); # -> 1726309</lang> |
||
=={{header|Phix}}== |
|||
<lang Phix>?scanf("0b10101010","%d") |
|||
?scanf("#ABCD","%d") |
|||
?scanf("#FFFFFFFF","%f") |
|||
?scanf("0o377","%o")</lang> |
|||
{{out}} |
|||
<pre> |
|||
{{170}} |
|||
{{43981}} |
|||
{{4294967295}} |
|||
{{255}} |
|||
</pre> |
|||
Note the need for %f (if you want to get an atom rather than an integer back), and double braces (it's a list of potentially several different possible interpretations), and that scanf() works best with a few literals (esp spaces). |
|||
=={{header|PHP}}== |
=={{header|PHP}}== |