Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/tools/exp445/arms/examples/power_mod/prompt # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / tools / exp445 / arms / examples / power_mod / prompt` 4 lines ยท 391 bytes Raw Blame History 1 Write a function power_mod that takes three unsigned 32-bit numbers b, e and m and returns b to the 2 power e, modulo m (0 to the power 0 is 1). Work in unsigned 64-bit numbers: start with r = 1 mod m 3 and x = b mod m, then while e > 0: if e is odd, r = r * x mod m; x = x * x mod m; e = e / 2. Use a 4 helper function for "a * b mod m". When m is 0 the run stops with trap 2 (division by zero).