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
11
12
# PMAT-502m (Tranche 2): numeric conversions int(x) / float(x).
# int() truncates toward zero (like Python); float() widens int -> f64.
def to_float(n: int) -> float:
    return float(n)


def to_int(x: float) -> int:
    return int(x)


def half(n: int) -> float:
    return float(n) / 2.0