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.om
| 1 | fn power_mod_u32 a uint b uint to uint |
| 2 | res = uint 1 |
| 3 | cur = a |
| 4 | exp = b |
| 5 | while gt exp 0 |
| 6 | if eq (and exp 1) 1 |
| 7 | res = mul res cur |
| 8 | end |
| 9 | cur = mul cur cur |
| 10 | exp = shr exp 1 |
| 11 | end |
| 12 | ret res |
| 13 | end |