Skip to content

0.4.2

Choose a tag to compare

@franknoh franknoh released this 28 Sep 07:48
· 257 commits to main since this release
517ceb1

Changes

  • Fixed: int(x) of a float in native code returned -263 on x86 for NaN, an infinity, or a value past 263, and was undefined behavior in emitted C. It now gives CPython's answer:
x ppy run standalone binary, emitted C/C++
NaN ValueError: cannot convert float NaN to integer the same, exit status 1
±infinity OverflowError: cannot convert float infinity to integer the same, exit status 1
past 2**63 the exact integer OverflowError: the result does not fit in a 64-bit integer, exit status 1

The checks are range checks, so --unsafe keeps them. Nothing saturates to the largest or smallest word, since Python's integers have no largest. A value that fits still converts natively, truncated toward zero.

Install or upgrade with pip install --upgrade ppy-lang==0.4.2.

The full repository gate passed: 1,917 tests, 44/44 examples on all three paths, and the documentation examples.