* fixed for extended = double

This commit is contained in:
Jonas Maebe 2004-01-01 15:49:21 +00:00
parent e90bd0332a
commit f9152c2c6b
2 changed files with 22 additions and 4 deletions

View File

@ -10,19 +10,32 @@ const Inf=1/0;
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<>' +Inf' then
if s<>s1 then
error:=true;
str(NaN,s);
writeln('Nan: "',s,'"');
if s<>' Nan' then
if s<>s2 then
error:=true;
str(MinusInf,s);
writeln('MinusInf: "',s,'"');
if s<>' -Inf' then
if s<>s3 then
error:=true;
if error then
begin

View File

@ -4,6 +4,7 @@
program pbug;
var d:double;
s:string;
s1:string;
begin
d:=5168568.5;
str(d:10,s);
@ -19,7 +20,11 @@ begin
halt(1);
end;
str(d,s);
if s<>' 5.168568500000000E+006' then
if sizeof(extended) > 8 then
s1 := ' 5.168568500000000E+006'
else
s1 := ' 5.16856850000000E+006';
if s<>s1 then
begin
writeln(s);
halt(1);