interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / tests / x86efi / float / body.om

98 lines · 1385 bytes Raw Blame History
1note gate 3 body: one hex line per result (bit pattern of an f64/f32 or of an integer result), each
2note line flushed by its own emit call, so a, b, z and k stay live across every console call.
3
4fn hx v ulong to void
5i = ulong 0
6while lt i 16
7d = and shr v mul sub 15 i 4 15
8if lt d 10
9put ms i uchar add 48 d
10else
11put ms i uchar add 87 d
12end
13i = add i 1
14end
15put ms 16 10
16emit 17
17end
18
19fn hf x f64 to void
20hx bitcast ulong x
21end
22
23fn hl x long to void
24hx bitcast ulong x
25end
26
27fn fv x f64 to f64
28ret x
29end
30
31fn lv x long to long
32ret x
33end
34
35fn uv x ulong to ulong
36ret x
37end
38
39fn run to void
40a = fv 1.5
41b = fv 3.25
42z = fv 0.0
43k = fsqrt fv 2.0
44hf add a b
45hf sub a b
46hf mul fv 1.1 fv 3.3
47hf div fv 1.0 fv 3.0
48hf div a z
49hf div z z
50hf k
51hf fsqrt fv -1.0
52hf fexp fv 1.0
53hf fexp fv 0.5
54hf fexp fv -740.0
55hf fexp fv 709.0
56hf fexp fv 710.0
57hf flog fv 2.0
58hf flog fv 10.0
59hf flog fv 1e-310
60hf flog z
61hf flog fv -1.0
62hf f64 lv -7
63hf f64 uv 18446744073709551615
64hf f64 lv 9007199254740993
65hl long fv 1e300
66hl long fv -1e300
67hl long div z z
68hl long fv -2.5
69hx ulong fv -5.0
70hx ulong fv 1.8e19
71i = int fv 3e9
72hl long i
73u = uchar fv 300.0
74hx ulong u
75s = f32 fv 0.1
76hx ulong bitcast uint s
77hf f64 s
78hf fmin div z z fv 1.5
79hf fmax fv -0.0 z
80q = bitcast f64 ulong 9218868437227405313
81hf add q 1.0
82n = div z z
83if ne n n
84hx 1
85else
86hx 0
87end
88if eq n n
89hx 1
90else
91hx 0
92end
93hf a
94hf b
95hf z
96hf k
97hf mul add a b k
98end