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 / arith.om
| 1 | note add, sub, mul, div and neg on f64 and f32; truncating conversions make the results observable. |
| 2 | fn main to int |
| 3 | if ne int add 1.5f64 2.25f64 3 |
| 4 | ret 1 |
| 5 | end |
| 6 | if ne int mul 1.5f64 2.25f64 3 |
| 7 | ret 2 |
| 8 | end |
| 9 | if ne int sub 5.5f64 2.25f64 3 |
| 10 | ret 3 |
| 11 | end |
| 12 | if ne int div 10.0f64 4.0f64 2 |
| 13 | ret 4 |
| 14 | end |
| 15 | if ne int neg 2.5f64 -2 |
| 16 | ret 5 |
| 17 | end |
| 18 | if ne int mul f32 1.5f32 f32 4.0f32 6 |
| 19 | ret 6 |
| 20 | end |
| 21 | ret 0 |
| 22 | end |