summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/test/twrstr8.pp
blob: 34b1832260f9ca7d0d59abe80604a4c1b42919e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ from GPC test suite }

program LongRealBug;
{ Dagegen ist Intels legend?rer Pentium-Bug eine Kleinigkeit!!!}

const
  Pi = 3.14159265358979323846;

var
  Pi_L : extended;
  Pi_R : Real;
  S : String [10];

begin
  Pi_L := Pi;
  Pi_R := Pi;

  WriteStr( S, sin(Pi)   :10:5 );
  if ( S <> '   0.00000' ) and ( S <> '  -0.00000' ) then
    halt(1);
  WriteStr( S, sin(Pi_L) :10:5 );
  if ( S <> '   0.00000' ) and ( S <> '  -0.00000' ) then
    halt(1);
  WriteStr( S, sin(Pi_R) :10:5 );
  if ( S <> '   0.00000' ) and ( S <> '  -0.00000' ) then
    halt(1);

  WriteStr( S, cos(Pi)   :10:5 );
  if S <> '  -1.00000' then
    halt(1);
  WriteStr( S, cos(Pi_L) :10:5 );
  if S <> '  -1.00000' then
    halt(1);
  WriteStr( S, cos(Pi_R) :10:5 );
  if S <> '  -1.00000' then
    halt(1);

  writeln ( 'OK' );
end.