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 / tools / exp445 / arms / examples / narrow_sum / prompt
| 1 | Write a function narrow_sum that takes two signed 16-bit numbers a and b and returns a + b as a |
| 2 | signed 8-bit number. If a + b does not fit in a signed 16-bit number, the run stops with trap 1 |
| 3 | (overflow); if it fits in 16 bits but not in a signed 8-bit number, the run stops with trap 5 |
| 4 | (conversion out of range). |