tw2001.pp 1.0 KB

123456789101112131415161718192021222324
  1. { %version=1.1}
  2. { Source provided for Free Pascal Bug Report 2001 }
  3. { Submitted by "Gene Hardesty" on 2002-06-09 }
  4. { e-mail: [email protected] }
  5. program qwrdbug;
  6. const
  7. terabytes=1024*1024*1024*1024; // Compiler can't do math
  8. terabytes1:qword=1024*1024*1024*1024; // Typing doesn't work
  9. terabytes2=1099511627776; // Thx to CALC for the number
  10. var
  11. terabytes3:qword;
  12. terabytes4:int64; // Just for comparison
  13. begin
  14. terabytes3:=qword (terabytes2); // This doesn't work either.
  15. terabytes3:=qword (1099511627776); // This doesn't work too.
  16. terabytes3:=1024*1024*1024*1024;
  17. terabytes4:=1024*1024*1024*1024;
  18. writeln (terabytes); // Displays 0
  19. writeln (terabytes1); // Also displays 0
  20. writeln (terabytes2:2); // The compiler treats it as a REAL
  21. writeln (terabytes3); // Displays 0
  22. writeln (terabytes4); // Also displays 0
  23. end.