Comments on Make my value binary
Post
Make my value binary
Challenge
What do computers understand? That's right, binary. All files are turned into binary digits when you run them, but what if I suggest giving you an int
then turn it into it's binary value.
- Take input of a non-negative decimal integer and output its binary value/form.
- Any preceding zeros don't need to be outputted.
- This is code-golf, so the shortest program wins. Yep, not by language.
Test Cases
n = 0
Output: 0
n = 1
Output: 1
n = 5
Output: 101
n = 12
Output: 1100
n = 31
Output: 11111
n = 4096
Output: 1000000000000
[C (gcc)], 35 32 bytes Save …
3y ago
[Ahead], 20 bytes ```ahead …
3y ago
[jq], 48 bytes [while(. …
3y ago
Vyxal, 1 byte ``` b ``` …
3y ago
Embed ESCR, 16 characters [ …
3y ago
[dc], 4 bytes 2o?p T …
3y ago
J, 2 bytes ```J #: ``` …
3y ago
[Julia 1.0], 9 bytes …
3y ago
[Ruby], 11 bytes ```ruby - …
3y ago
[Python 3], 3 bytes …
3y ago
[Haskell], 29 bytes …
3y ago
[Sclipting], (UTF-16) 14 bytes …
3y ago
JavaScript, 16 bytes …
3y ago
Japt, 1 byte ¤ Try i …
3y ago
1 comment thread