twrstr8.pp 810 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. { from GPC test suite }
  2. program LongRealBug;
  3. { Dagegen ist Intels legend?rer Pentium-Bug eine Kleinigkeit!!!}
  4. const
  5. Pi = 3.14159265358979323846;
  6. var
  7. Pi_L : extended;
  8. Pi_R : Real;
  9. S : String [10];
  10. begin
  11. Pi_L := Pi;
  12. Pi_R := Pi;
  13. WriteStr( S, sin(Pi) :10:5 );
  14. if ( S <> ' 0.00000' ) and ( S <> ' -0.00000' ) then
  15. halt(1);
  16. WriteStr( S, sin(Pi_L) :10:5 );
  17. if ( S <> ' 0.00000' ) and ( S <> ' -0.00000' ) then
  18. halt(1);
  19. WriteStr( S, sin(Pi_R) :10:5 );
  20. if ( S <> ' 0.00000' ) and ( S <> ' -0.00000' ) then
  21. halt(1);
  22. WriteStr( S, cos(Pi) :10:5 );
  23. if S <> ' -1.00000' then
  24. halt(1);
  25. WriteStr( S, cos(Pi_L) :10:5 );
  26. if S <> ' -1.00000' then
  27. halt(1);
  28. WriteStr( S, cos(Pi_R) :10:5 );
  29. if S <> ' -1.00000' then
  30. halt(1);
  31. writeln ( 'OK' );
  32. end.