home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1991 / 04 / review / testfpp.mod < prev   
Text File  |  1991-01-05  |  822b  |  45 lines

  1. MODULE TestFPP;
  2.  
  3. (* TestModul Floating-Point Emulator *)
  4.  
  5. FROM InOut IMPORT WriteString, WriteLn, Write, Read;
  6. FROM MathLib0 IMPORT sqrt, ln;
  7.  
  8. VAR a,b,c,d     : LONGREAL;
  9.     ch          : CHAR;
  10.     i           : CARDINAL;
  11.  
  12. BEGIN
  13.   WriteString("Test 0.5 :"); Read(ch); WriteLn;
  14.   b := 0.0; d := 0.05;
  15.   a := 0.3; c := 0.2;
  16.   FOR i := 0 TO 50000 DO
  17.     b := b+0.1;
  18.     a := a+3.0*b-a*b;
  19.     IF ABS(b) > 0.1 THEN
  20.       a := 0.0;
  21.       b := 0.0;
  22.     END;
  23.   END;
  24.   Write(7C);
  25.  
  26.   WriteString("Test 1 :"); Read(ch); WriteLn;
  27.   FOR i := 0 TO 10000 DO
  28.     b := sqrt(b)+ABS(a);
  29.     a := ln(b);
  30.   END;
  31.   Write(7C);
  32.  
  33.   WriteString("Test 2.5 :");  Read(ch); WriteLn;
  34.   c := 3.7; b := 4.2; a := 1.3; d := 0.0;
  35.   FOR i := 0 TO 50000 DO
  36.     d := b+c*a+d;
  37.   END;
  38.   Write(7C);
  39.  
  40. END TestFPP.
  41.  
  42.  
  43.  
  44.  
  45.