interplane.Get Omega
Read in your language

omega-bridge

Omega-first language interoperability: checked conversion backends and native language bindings

Brought by drakestapleton

branch main Branches Tags History

omega-bridge / tests / native / freestanding / f64.om

20 lines · 401 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2om2
3fn average a f64 b f64 to f64
4two = f64 2.0e+0
5ret div add a b two
6end
7export fn fbits mode ulong abits ulong bbits ulong to ulong
8a = bitcast f64 abits
9b = bitcast f64 bbits
10if eq mode 0
11ret bitcast ulong add a b
12end
13if eq mode 1
14ret bitcast ulong div a b
15end
16if eq mode 2
17ret bitcast ulong neg a
18end
19ret bitcast ulong average a b
20end