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
def s(x: float) -> str:
    # CPython uses scientific notation for floats whose decimal exponent is
    # < -4 or >= 16 (e.g. 1e16 -> "1e+16", 1e-5 -> "1e-05"); Rust's `{}` spells
    # them out instead. str()/repr()/print()/f-strings all route through this.
    return str(x)