home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turbo Toolbox
/
Turbo_Toolbox.iso
/
1991
/
04
/
review
/
testfpp.mod
< prev
Wrap
Text File
|
1991-01-05
|
822b
|
45 lines
MODULE TestFPP;
(* TestModul Floating-Point Emulator *)
FROM InOut IMPORT WriteString, WriteLn, Write, Read;
FROM MathLib0 IMPORT sqrt, ln;
VAR a,b,c,d : LONGREAL;
ch : CHAR;
i : CARDINAL;
BEGIN
WriteString("Test 0.5 :"); Read(ch); WriteLn;
b := 0.0; d := 0.05;
a := 0.3; c := 0.2;
FOR i := 0 TO 50000 DO
b := b+0.1;
a := a+3.0*b-a*b;
IF ABS(b) > 0.1 THEN
a := 0.0;
b := 0.0;
END;
END;
Write(7C);
WriteString("Test 1 :"); Read(ch); WriteLn;
FOR i := 0 TO 10000 DO
b := sqrt(b)+ABS(a);
a := ln(b);
END;
Write(7C);
WriteString("Test 2.5 :"); Read(ch); WriteLn;
c := 3.7; b := 4.2; a := 1.3; d := 0.0;
FOR i := 0 TO 50000 DO
d := b+c*a+d;
END;
Write(7C);
END TestFPP.