interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / tests / universal / arithmetic.py

11 lines · 372 bytes Raw Blame History
1"""CPython bigint reference and explicitly different masked-u64 reference."""
2import sys
3mode = sys.argv[1]
4assert mode in ('u64', 'bigint')
5for line in sys.stdin:
6 a, b = map(int, line.split())
7 assert 0 <= a < 2**64 and 0 < b < 2**64
8 values = (a+b, a-b, a*b, a//b)
9 if mode == 'u64':
10 values = tuple(v & (2**64-1) for v in values)
11 print(*values)