2
0

tstrreal1.pp 735 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. const
  2. s: array[0..16] of string[13] =
  3. ('99999.900000',
  4. '99999.990000',
  5. '99999.999000',
  6. '99999.999900',
  7. '99999.999990',
  8. '99999.999999',
  9. '100000.000000',
  10. '100000.000000',
  11. '100000.000000',
  12. '100000.000000',
  13. '100000.000000',
  14. '100000.000000',
  15. '100000.000000',
  16. '100000.000000',
  17. '100000.000000',
  18. '100000.000000',
  19. '100000.000000');
  20. var
  21. e,e2,e3: double;
  22. s2: string;
  23. c: longint;
  24. begin
  25. e := 100000.0;
  26. e2 := 0.1;
  27. c := 0;
  28. repeat
  29. e3 := e-e2;
  30. str(e3:0:6,s2);
  31. writeln(s2);
  32. if s2 <> s[c] then
  33. begin
  34. writeln(' Error, should be ',s[c]);
  35. halt(1);
  36. end;
  37. e2 := e2 /10.0;
  38. inc(c);
  39. until e2 < 1e-17;
  40. end.