home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / REALST.ZIP / TEST.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1990-07-05  |  1.5 KB  |  50 lines

  1. {$M $1000,$1000,$1000}
  2. {$R+}     { Range checking on                }
  3. {$B-}     { Boolean complete evaluation off  }
  4. {$S-}     { Stack checking off               }
  5. {$I-}     { I/O checking off                 }
  6. {$V-}     { Relaxed variable checking        }
  7. {$N+}     { Numeric coprocessor              }
  8. {$E+}     { Numeric coprocessor emulation    }
  9.  
  10. Program test;
  11.  
  12. Uses Crt, Dos, RealStr;
  13.  
  14. (*****************************************************************************)
  15. (************************     Main program     *******************************)
  16. var
  17. AReal   : real;
  18. ASingle : single;
  19. i       : word;
  20.    begin
  21.    repeat
  22.       writeln;
  23.       write ('Enter a Number   ');
  24.       readln (AReal);
  25.       if AReal = 0 then exit;
  26.       ASingle := AReal;
  27.       writeln;
  28.       writeln ('                       Single                      Real');
  29.       writeln ('                ----------------------    ----------------------');
  30.       write   ('    write () =');
  31.       GoToXY (16, WhereY); write (ASingle);
  32.       GoToXY (42, WhereY); writeln (AReal);
  33.  
  34.       for i := 15 downto 1 do
  35.          begin
  36.          write ('   ',i);
  37.          GoToXY (7, WhereY);
  38.          write ('Digits =');
  39.          GoToXY (16, WhereY);
  40.          write (RealToString (i, ASingle));
  41.          GoToXY (42, WhereY);
  42.          writeln (RealToString (i, AReal));
  43.          end;
  44.  
  45.       writeln;
  46.       writeln;
  47.    until false;      { Exit loop by entering 0 or non-numeric value at readln }
  48.    end.
  49.  
  50.