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 / seed / equiv / clamp.unit.om

20 lines · 491 bytes Raw Blame History
1note irequiv fixture (issue 826): saturating byte add, two parameters (u16 domain).
2note clamp_add is copied verbatim from tests/one_layer/omegese/dev/dev01.omegese
3note (omega-mv 62d1d0d6). clamp_wrap is a refactor that adds in uchar and
4note detects the wrap instead of widening to ushort.
5fn clamp_add a uchar b uchar to uchar
6x = ushort a
7y = ushort b
8s = add x y
9if gt s 255
10ret 255
11end
12ret uchar s
13end
14fn clamp_wrap a uchar b uchar to uchar
15s = add a b
16if lt s a
17ret 255
18end
19ret s
20end