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
omega-mv / seed / omc / tests / float / f64_bits.om
| 1 | note literals convert exactly: every constant here was computed outside this compiler (IEEE-754 bits). |
| 2 | fn main to int |
| 3 | a = bitcast ulong f64 1.5 |
| 4 | if ne a 4609434218613702656 |
| 5 | ret 1 |
| 6 | end |
| 7 | b = bitcast ulong f64 0.1 |
| 8 | if ne b 4591870180066957722 |
| 9 | ret 2 |
| 10 | end |
| 11 | c = bitcast ulong f64 3.141592653589793 |
| 12 | if ne c 4614256656552045848 |
| 13 | ret 3 |
| 14 | end |
| 15 | d = bitcast ulong f64 1e-3 |
| 16 | if ne d 4562254508917369340 |
| 17 | ret 4 |
| 18 | end |
| 19 | e = bitcast ulong f64 -0.0 |
| 20 | if ne e 9223372036854775808 |
| 21 | ret 5 |
| 22 | end |
| 23 | f = bitcast ulong f64 6.02214076e23 |
| 24 | if ne f 4962933279127225623 |
| 25 | ret 6 |
| 26 | end |
| 27 | g = bitcast ulong f64 1.602176634e-19 |
| 28 | if ne g 4325607224011134547 |
| 29 | ret 7 |
| 30 | end |
| 31 | h = bitcast ulong f64 1e308 |
| 32 | if ne h 9214871658872686752 |
| 33 | ret 8 |
| 34 | end |
| 35 | i = bitcast ulong f64 5e-324 |
| 36 | if ne i 1 |
| 37 | ret 9 |
| 38 | end |
| 39 | j = bitcast ulong f64 1e-324 |
| 40 | if ne j 0 |
| 41 | ret 10 |
| 42 | end |
| 43 | k = bitcast ulong f64 1.7976931348623158e308 |
| 44 | if ne k 9218868437227405311 |
| 45 | ret 11 |
| 46 | end |
| 47 | ret 0 |
| 48 | end |