tb0591.pp 511 B

1234567891011121314151617181920212223242526272829
  1. program tb0591;
  2. uses
  3. Math;
  4. procedure TestValue(aActual, aExpected: Double);
  5. begin
  6. if not SameValue(aActual, aExpected) then
  7. Halt(1);
  8. end;
  9. const
  10. f1 = 2.;
  11. f2 = 2.e10;
  12. f3 = 2.e-10;
  13. f4 = 2.e+10;
  14. f5 = 2.8e10; // ensure that scanning of normal floating points is not broken
  15. begin
  16. TestValue(2., 2.0);
  17. TestValue(2.e10, 2.0e10);
  18. TestValue(2.e-10, 2.0e-10);
  19. TestValue(2.e+10, 2.0e+10);
  20. TestValue(f1, 2.0);
  21. TestValue(f2, 2.0e10);
  22. TestValue(f3, 2.0e-10);
  23. TestValue(f4, 2.0e+10);
  24. end.