xpile 0.1.616

Polyglot transpile workbench (Python/C/C++/Rust/Ruchy/Lean ↔ Rust/Ruchy/PTX/WGSL/SPIR-V) with provable contracts at every layer.
1
2
3
4
5
6
7
8
9
10
# PMAT-614: Python float `//` is CPython float_divmod (fmod-based), NOT
# (a / b).floor(). The naive floor over-rounds when a/b lands just below an
# integer in float repr (1.0 // 0.1 == 9.0, not 10.0) and mishandles infinite
# operands (inf // 2 == nan, -5.0 // inf == -1.0).
def floordiv(a: float, b: float) -> float:
    return a // b


def steps(total: float, step: float) -> float:
    return total // step