Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-rosetta/blob/main/drafts/rosettacode/binary-digits.wiki # omega-rosetta aien-dev/omega-rosetta Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-rosetta / drafts / rosettacode / binary-digits.wiki` 49 lines ยท 892 bytes Raw Blame History 1 =={{header|Omegese}}== 2 {{works with|omc|sha256 `2c824805`, aien-dev/omega-mv `e5b32567`, Linux AArch64}} 3 Omega has no imports, so the small output helpers (emit and friends) are part of the program. 4 5 om2 6 text nl "\n" 7 note emit writes every byte of a to stdout; a short write is retried, an error exits 1 8 fn emit a view uchar * to void 9 o = ulong 0 10 while lt o len a bound 4096 11 k = write 1 a o sub len a o 12 if le k 0 13 exit 1 14 end 15 o = add o ulong k 16 end 17 end 18 fn bin n ulong to void 19 d = new uchar 64 0 20 i = ulong 64 21 v = n 22 while true bound 64 23 i = sub i 1 24 put d i uchar add and v 1 48 25 v = shr v 1 26 if eq v 0 27 break 28 end 29 end 30 emit part d i sub 64 i 31 emit nl 32 end 33 fn main to int 34 bin 0 35 bin 5 36 bin 50 37 bin 9000 38 bin `18446744073709551615` 39 ret 0 40 end 41 42 {{out}} 43

44 0

45 101

46 110010

47 `10001100101000`

48 `1111111111111111111111111111111111111111111111111111111111111111`

49