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 / halve_or_dec_steps / program.osc

9 lines · 212 bytes Raw Blame History
1fn halve_or_dec_steps(n: u32) -> u32 {
2 let mut x: u32 = n;
3 let mut k: u32 = 0;
4 while x > 1 bound 64 {
5 if x % 2 == 0 { x = x / 2; } else { x = x - 1; }
6 k = k + 1;
7 }
8 return k;
9}