raz / conform / run / FillReals.raz

25 lines · 647 B · raw · history · last change e19ed1d8

1module FillReals;
2import Out, F32s := Filled(F32), F64s := Filled(F64);
3
4var window: [576]F32; w: []F64; ws: [3]F64;
5
6proc main*;
7var i: INT; t: F64;
8begin
9 F32s.check("F32", 1.5, -2.25);
10 F64s.check("F64", -1.0E300, 3.5);
11
12 for i := 0 to 575 do window[i] := F32(i); end;
13 FILL(window, 0.0);
14 t := 0.0;
15 for i := 0 to 575 do t := t + F64(window[i]); end;
16 Out.int(I64(t)); Out.char(' ');
17 w := ws;
18 FILL(w, 0.25);
19 FILL(w[1..2], -0.0); (* not zero bits *)
20 Out.int(I64(4.0 * (ws[0] + ws[2]))); Out.char(' ');
21 if (ws[1] = 0.0) and (1.0 / ws[1] < 0.0) then Out.str("-0"); end;
22 Out.ln;
23end;
24
25end FillReals.