File size: 447 Bytes
3f7ca89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""Integer in binary
Composed by composer_v2 from typed moves; read back against its examples. digits in positional notation, base 2 (binary)"""
import math
import re


def _nums(code):
    return [float(x) for x in re.findall(r"\d+(?:\.\d+)?", str(code))]


def compute(x1):
    n, b, digits, out = int(x1), 2, '0123456789abcdef', ''
    if n == 0:
        return '0'
    while n:
        out = digits[n % b] + out
        n //= b
    return out