math.concat(): concatenate 2 integers (e.g. contcat(12, 34) == 1234)
This commit is contained in:
parent
e06e536292
commit
6adb1ff457
@ -38,3 +38,7 @@ def mul(ints: Iterable[int]) -> int:
|
||||
|
||||
def magnitude(value: int | float) -> int:
|
||||
return math.floor(math.log10(value))
|
||||
|
||||
|
||||
def concat(value1: int, value2: int) -> int:
|
||||
return value1 * (10 ** (1 + magnitude(value2))) + value2
|
||||
|
||||
Loading…
Reference in New Issue
Block a user