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
omega-mv / bench / inference_cost / tasks / task14 / reference.rs
| 1 | fn power_mod_u32(a: u32, b: u32) -> u32 { |
| 2 | let (mut r, mut c, mut e) = (1u32, a, b); |
| 3 | while e != 0 { if e & 1 == 1 { r = r.wrapping_mul(c); } c = c.wrapping_mul(c); e >>= 1; } |
| 4 | r |
| 5 | } |