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/omc/tests/float/convert.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 / omc / tests / float / convert.om` 30 lines ยท 406 bytes Raw Blame History 1 note int<->float, f32<->f64: truncate, saturate, NaN to 0, round to nearest even. 2 fn main to int 3 if ne int f64 -3.7 -3 4 ret 1 5 end 6 if ne int f64 3.9 3 7 ret 2 8 end 9 if ne int f64 3e9 `2147483647` 10 ret 3 11 end 12 n = div 0.0f64 0.0f64 13 if ne int n 0 14 ret 4 15 end 16 if ne int f64 1.5 1 17 ret 5 18 end 19 x = f32 0.1 20 y = f64 x 21 if ne int mul y 10.0f64 1 22 ret 6 23 end 24 z = f64 0.1 25 w = f32 z 26 if ne bitcast uint w `1036831949` 27 ret 7 28 end 29 ret 0 30 end