Using Float type as a parameter. |
Pas2JS pascal source code
type TMyFloat = Float; var v: TMyFloat; f: Float; begin v := 21.4; f := v; v := f + v; Writeln(v); // 42.8 if v < 1 then Writeln('bug'); function Proc1(a: TMyFloat): Float; begin Result := a; end; function Proc2(a: Float): TMyFloat; begin Result := a; end; Writeln(Proc1(123)); // 123 Writeln(Proc2(1234)); // 1234 Writeln(Proc1(2.0) * Proc2(3.14)); // 6.28