Binary digits: Difference between revisions

Content added Content deleted
No edit summary
Line 1,061: Line 1,061:
9000000000, 1000011000011100010001101000000000
9000000000, 1000011000011100010001101000000000
</pre>
</pre>

=={{header|Futhark}}==

We produce the binary number as a 64-bit integer whose digits are all 0s and 1s - this is because Futhark does not have any way to print, nor strings for that matter.

<lang Futhark>
fun main(x: i32): i64 =
loop (out = 0i64) = for i < 32 do
let digit = (x >> (31-i)) & 1
let out = (out * 10i64) + i64(digit)
in out
in out
</lang>


=={{header|Frink}}==
=={{header|Frink}}==