pydsa.arith¶
Integer arithmetic helpers.
ceil_div ¶
ceil_div(a: int, b: int) -> int
a / b rounded up, for a >= 0 and b > 0.
Source code in pydsa/arith.py
7 8 9 10 11 12 13 | |
batched ¶
batched(s: Sequence[Any], n: int = 1) -> List[Any]
s cut into pieces of n; the last piece holds what is left.
Source code in pydsa/arith.py
16 17 18 19 | |