blob: c068b23d7130a257cadfd5666265df499db9d5e7 (
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
40
41
42
43
44
45
46
47
48
49
50
51
|
{ %version=1.1 }
{$ifdef fpc}
{$MODE DELPHI}
{$endif}
{ Range and overflow checks need to be off }
{$Q-}
{$R-}
const Inf=1/0;
NaN=0/0;
MinusInf=-Inf;
var
s : string;
error : boolean;
s1, s2, s3 : string;
begin
if sizeof(extended) > 8 then
begin
s1 := ' +Inf';
s2 := ' Nan';
s3 := ' -Inf';
end
else
begin
s1 := ' +Inf';
s2 := ' Nan';
s3 := ' -Inf';
end;
error:=false;
str(Inf,s);
writeln('Inf: "',s,'"');
if s<>s1 then
error:=true;
str(NaN,s);
writeln('Nan: "',s,'"');
if s<>s2 then
error:=true;
str(MinusInf,s);
writeln('MinusInf: "',s,'"');
if s<>s3 then
error:=true;
if error then
begin
writeln('ERROR!');
halt(1);
end;
end.
|