xpile 0.1.615

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
13
14
15
16
17
18
# PMAT-710: a bool operand into a float-coercing op (/ // % **) emitted
# `(bool) as f64` → rustc E0606. Python's bool is an int subtype (True/2 == 0.5),
# so xpile now casts through i64: `((b) as i64) as f64`. One to_f64_operand fix
# covers all four operators.
def div(a: bool, b: int) -> float:
    return a / b


def floordiv(a: bool, b: float) -> float:
    return a // b


def modulo(a: bool, b: float) -> float:
    return a % b


def power(a: bool, b: float) -> float:
    return a ** b