| 12345678910111213141516171819202122232425262728293031323334353637 |
- program t100_realexpr;
- { t100 -- REAL literals, comparisons and + - * /. The runtime's MBF
- arithmetic entries do the work; the compiler packs each operation into a
- 12-byte block and keeps the result address as a REAL value. }
- type
- R = record
- V : real;
- end;
- var
- A, B, C : R;
- S : string[20];
- begin
- A.V := 2;
- B.V := 3;
- C.V := A.V + B.V;
- Str (C.V : 0 : 0, S);
- writeln (S);
- C.V := B.V - A.V;
- Str (C.V : 0 : 0, S);
- writeln (S);
- C.V := A.V * B.V;
- Str (C.V : 0 : 0, S);
- writeln (S);
- C.V := B.V / A.V;
- Str (C.V : 0 : 1, S);
- writeln (S);
- A.V := 1.5;
- Str (A.V : 0 : 1, S);
- writeln (S);
- if A.V < B.V then
- writeln ('TRUE')
- else
- writeln ('FALSE')
- end.
|