blob: 8e9cd352b205bfa8a9d6b87e46402f7ec0a6b393 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
namespace;
include rt;
fn put_f(x) { asm { x @ #1220 } return 0; }
fn f2i(x) { return asm { x @ #1218 }; }
fn i2f(x) { return asm { x @ #1216 }; }
fn sp() { rt.put_c(32); return 0; }
fn main() {
let a = 1.5;
let b = 2.5;
put_f(a + b); sp();
put_f(7.0 - 2.5); sp();
put_f(1.5 * 2); sp();
put_f(10.0 / 4.0); sp();
put_f(1 + 1.5); sp();
put_f(1.5e-3); sp();
put_f(0.1); sp();
put_f(-0.125); sp();
put_f(1.0 / 0.0); sp();
put_f(-1.0 / 0.0); sp();
put_f(0.0 / 0.0); sp();
rt.put_n(1.5 < 2.0); sp();
rt.put_n(2.0 <= 2.0); sp();
rt.put_n(2.0 == 2); sp();
rt.put_n(1.5 == 1); sp();
rt.put_n(3.0 > 3.5); sp();
rt.put_n(f2i(3.9)); sp();
rt.put_n(f2i(-3.9)); sp();
put_f(i2f(3)); sp();
put_f(i2f(-2)); sp();
rt.put_n(10 / 4);
rt.put_c(10);
return 0;
}
|