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 / tools / exp445 / arms / examples / narrow_sum / prompt

4 lines · 313 bytes Raw Blame History
1Write a function narrow_sum that takes two signed 16-bit numbers a and b and returns a + b as a
2signed 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).