tb0621.pp 471 B

123456789101112131415161718192021222324252627
  1. PROGRAM compbug300;
  2. VAR x1, x2 : comp;
  3. (* Dividing 8 / 2 doesn't work with fpc 3.0.0
  4. but works for example with fpc 2.6.4
  5. Markus Greim / 29.jun.2016 *)
  6. BEGIN
  7. x1 := 8;
  8. writeln('x1 : ',x1);
  9. x2 := x1 / 2;
  10. writeln('x2 = x1/2 should be 4 but is : ', x2);
  11. if x2<>4 then
  12. halt(1);
  13. x2 := x1 / 4;
  14. writeln('x2 = x1/4 should be 2 but is : ', x2);
  15. if x2<>2 then
  16. halt(2);
  17. x2 := x1 / 8.0;
  18. writeln('x2 = x1/8.0 should be 1 and is : ', x2);
  19. if x2<>1 then
  20. halt(3);
  21. END.