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

19 lines · 431 bytes Raw Blame History
1fn dot(u: &[i64; 3], w: &[i64; 3]) -> i64 {
2 let mut s: i64 = 0;
3 for i in 0 .. 3 {
4 s = s + u[i] * w[i];
5 }
6 return s;
7}
8
9fn dot3(a: i16, b: i16, c: i16, x: i16, y: i16, z: i16) -> i64 {
10 let u: own [i64; 3] = alloc(0);
11 let w: own [i64; 3] = alloc(0);
12 u[0] = a as i64;
13 u[1] = b as i64;
14 u[2] = c as i64;
15 w[0] = x as i64;
16 w[1] = y as i64;
17 w[2] = z as i64;
18 return dot(&u, &w);
19}