tbug1021.pp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. { Source provided for Free Pascal Bug Report 1021 }
  2. { Submitted by "Oliver Puetz" on 2000-07-03 }
  3. { e-mail: [email protected] }
  4. {
  5. Free Pascal Compiler version 0.99.15 [2000/03/30] for i386
  6. Copyright (c) 1993-2000 by Florian Klaempfl
  7. Win NT 4.0 Fixpak 2
  8. With TFloat = EXTENDED Writeln resumes 0.0 0.0 1
  9. With TFloat = DOUBLE Writeln resumes 0.0 1.0 1
  10. Thus only the write-command seems not to transfer the extended a equals 1
  11. to a string like '1'
  12. }
  13. type tfloat = extended;
  14. var a, b : tfloat;
  15. i : INTEGER;
  16. f : text;
  17. begin
  18. case sizeof(tfloat) of
  19. 4: writeln('single');
  20. 8: writeln('double');
  21. 10: writeln('extended');
  22. else writeln(sizeof(tfloat));
  23. end;
  24. a := 0;
  25. b := 1 - a;
  26. i := Round(b);
  27. writeln(a:30:20, b:30:20, i:10);
  28. assign(f,'tbug1021.txt');
  29. rewrite(f);
  30. writeln(f,a:30:20,' ',b:30:20,' ',i:10);
  31. close(f);
  32. reset(f);
  33. read(f,a);
  34. read(f,b);
  35. read(f,i);
  36. if (a<>0.0) then
  37. begin
  38. Writeln('Error reading A value, should be zero');
  39. Halt(1);
  40. end;
  41. if (b<>1.0) then
  42. begin
  43. Writeln('Error reading B value, should be one');
  44. Halt(1);
  45. end;
  46. if (i<>1) then
  47. begin
  48. Writeln('Error reading I value, should be one');
  49. Halt(1);
  50. end;
  51. end.