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 / si / front-door / tools / adapter / half.om

17 lines · 296 bytes Raw Blame History
1fn h2f h ushort to f32
2v = uint h
3s = shl and shr v 15 1 31
4e = and shr v 10 31
5m = and v 1023
6if eq e 0
7z = mul f32 m 0.000000059604644775390625f32
8if eq s 0
9ret z
10end
11ret neg z
12end
13if eq e 31
14ret bitcast f32 or or s 2139095040 shl m 13
15end
16ret bitcast f32 or or s shl add e 112 23 shl m 13
17end