omega-harness
Agent skills for operating, encoding and communicating in Omega (.om) and the AIEN repositories
Brought by drakestapleton
omega-harness / examples / trap1_divmin.om
| 1 | note trap1_divmin: signed minimum div -1 overflows and traps 1 (exit 101), not 2; rem gives 0 |
| 2 | text before "before\n" |
| 3 | fn main to int |
| 4 | k = write 1 before 0 len before |
| 5 | m = sub long -9223372036854775807 1 |
| 6 | r = rem m long -1 |
| 7 | if ne r 0 |
| 8 | ret 1 |
| 9 | end |
| 10 | q = div m long -1 |
| 11 | ret 0 |
| 12 | end |