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 / bench / inference_cost / tasks / task06 / reference.om

13 lines · 187 bytes Raw Blame History
1fn collatz_steps_u32 n uint to uint
2steps = uint 0
3cur = ulong n
4while gt cur 1
5if eq (and cur 1) 0
6cur = div cur 2
7else
8cur = add (mul 3 cur) 1
9end
10steps = add steps 1
11end
12ret steps
13end