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-bridge/blob/main/tests/native/freestanding/f32.om # omega-bridge Omega-first language interoperability: checked conversion backends and native language bindings Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-bridge / tests / native / freestanding / f32.om` 50 lines ยท 818 bytes Raw Blame History 1 note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 om2 3 fn mean32 a f32 b f32 to f32 4 two = f32 2.0e+0f32 5 ret div add a b two 6 end 7 export fn f32bits mode ulong abits ulong bbits ulong cbits ulong to ulong 8 a = bitcast f32 uint abits 9 b = bitcast f32 uint bbits 10 c = bitcast f32 uint cbits 11 if eq mode 0 12 ret ulong bitcast uint a 13 end 14 if eq mode 1 15 ret ulong bitcast uint add a b 16 end 17 if eq mode 2 18 ret ulong bitcast uint div a b 19 end 20 if eq mode 3 21 ret ulong bitcast uint neg a 22 end 23 if eq mode 4 24 ret ulong bitcast uint mean32 a b 25 end 26 if eq mode 5 27 p = mul a b 28 ret ulong bitcast uint add p c 29 end 30 flags = ulong 0 31 if eq a b 32 flags = or flags 1 33 end 34 if ne a b 35 flags = or flags 2 36 end 37 if lt a b 38 flags = or flags 4 39 end 40 if le a b 41 flags = or flags 8 42 end 43 if gt a b 44 flags = or flags 16 45 end 46 if ge a b 47 flags = or flags 32 48 end 49 ret flags 50 end