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 / seed / ng / tests / ir / x-remmin.om
| 1 | note x-remmin: signed minimum rem -1 is 0 and does not trap (exit 5 when the remainder is 0, else 6) |
| 2 | fn f a long b long to long |
| 3 | ret rem a b |
| 4 | end |
| 5 | fn main to int |
| 6 | m = sub long -9223372036854775807 1 |
| 7 | r = f m -1 |
| 8 | if eq r 0 |
| 9 | ret 5 |
| 10 | end |
| 11 | ret 6 |
| 12 | end |