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 / compare.om
| 1 | note comparisons follow IEEE: unordered (NaN) makes every ordered comparison false and != true. |
| 2 | fn main to int |
| 3 | if not lt 1.5f64 2.0f64 |
| 4 | ret 1 |
| 5 | end |
| 6 | if lt 2.5f64 2.0f64 |
| 7 | ret 2 |
| 8 | end |
| 9 | if not le 2.0f64 2.0f64 |
| 10 | ret 3 |
| 11 | end |
| 12 | if not gt 3.0f64 2.0f64 |
| 13 | ret 4 |
| 14 | end |
| 15 | if not ge 3.0f64 3.0f64 |
| 16 | ret 5 |
| 17 | end |
| 18 | if not eq 2.0f64 2.0f64 |
| 19 | ret 6 |
| 20 | end |
| 21 | n = div 0.0f64 0.0f64 |
| 22 | if eq n n |
| 23 | ret 7 |
| 24 | end |
| 25 | if not ne n n |
| 26 | ret 8 |
| 27 | end |
| 28 | if lt n 1.0f64 |
| 29 | ret 9 |
| 30 | end |
| 31 | if le n 1.0f64 |
| 32 | ret 10 |
| 33 | end |
| 34 | if gt n 1.0f64 |
| 35 | ret 11 |
| 36 | end |
| 37 | if ge n 1.0f64 |
| 38 | ret 12 |
| 39 | end |
| 40 | ret 0 |
| 41 | end |