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
omega-mv / tests / universal / arithmetic.py
| 1 | """CPython bigint reference and explicitly different masked-u64 reference.""" |
| 2 | import sys |
| 3 | mode = sys.argv[1] |
| 4 | assert mode in ('u64', 'bigint') |
| 5 | for 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) |