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/seed/ng/a64/tests/ref/tsum.om # 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 / seed / ng / a64 / tests / ref / tsum.om` 13 lines ยท 461 bytes Raw Blame History 1 note tsum: ts(n) = ts(n - 1) + n, ts(0) = 0, on ulong (Omega wraps unsigned values: no check). ts(`1000000`) is 2 note `500000500000` (Wolfram), more than 2^31 - 1, so main takes its low byte before `int` (whose check, chk.conv 3 note trap 5, would otherwise fail): status 32. Under omc the recursion is a million calls deep and traps 6 (exit 106). 4 fn ts n ulong to ulong 5 if lt n 1 6 ret n 7 end 8 r = ts sub n 1 9 ret add r n 10 end 11 fn main to int 12 ret int and ts `1000000` 255 13 end