tw1720.pp 753 B

123456789101112131415161718192021222324252627
  1. { Source provided for Free Pascal Bug Report 1720 }
  2. { Submitted by "Jesse Towner" on 2001-12-09 }
  3. { e-mail: [email protected] }
  4. var a, b, c : single;
  5. begin
  6. (* ... other floating point code goes here *)
  7. a := 5.6;
  8. b := 3.4;
  9. b:= b + sqrt(b)- ln(a);
  10. c := a - (b-(b-1));
  11. if abs(c-(a-1))>0.01 then
  12. begin
  13. Writeln('Error in floating point code');
  14. halt(1);
  15. end;
  16. (* sometimes, depending on the previous code,
  17. the code generator will chose to swap the
  18. operands. however, it just calls the
  19. reverse version of the instruction without
  20. swapping the operands. this results in
  21. giving a value of (b-a) or -2.2 for c. the
  22. same goes for floating point division. *)
  23. end.