mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 04:06:08 +02:00
* fixed for extended = double
This commit is contained in:
parent
e90bd0332a
commit
f9152c2c6b
@ -10,19 +10,32 @@ const Inf=1/0;
|
|||||||
var
|
var
|
||||||
s : string;
|
s : string;
|
||||||
error : boolean;
|
error : boolean;
|
||||||
|
s1, s2, s3 : string;
|
||||||
begin
|
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;
|
error:=false;
|
||||||
str(Inf,s);
|
str(Inf,s);
|
||||||
writeln('Inf: "',s,'"');
|
writeln('Inf: "',s,'"');
|
||||||
if s<>' +Inf' then
|
if s<>s1 then
|
||||||
error:=true;
|
error:=true;
|
||||||
str(NaN,s);
|
str(NaN,s);
|
||||||
writeln('Nan: "',s,'"');
|
writeln('Nan: "',s,'"');
|
||||||
if s<>' Nan' then
|
if s<>s2 then
|
||||||
error:=true;
|
error:=true;
|
||||||
str(MinusInf,s);
|
str(MinusInf,s);
|
||||||
writeln('MinusInf: "',s,'"');
|
writeln('MinusInf: "',s,'"');
|
||||||
if s<>' -Inf' then
|
if s<>s3 then
|
||||||
error:=true;
|
error:=true;
|
||||||
if error then
|
if error then
|
||||||
begin
|
begin
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
program pbug;
|
program pbug;
|
||||||
var d:double;
|
var d:double;
|
||||||
s:string;
|
s:string;
|
||||||
|
s1:string;
|
||||||
begin
|
begin
|
||||||
d:=5168568.5;
|
d:=5168568.5;
|
||||||
str(d:10,s);
|
str(d:10,s);
|
||||||
@ -19,7 +20,11 @@ begin
|
|||||||
halt(1);
|
halt(1);
|
||||||
end;
|
end;
|
||||||
str(d,s);
|
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
|
begin
|
||||||
writeln(s);
|
writeln(s);
|
||||||
halt(1);
|
halt(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user