* fixed real48 to double conversion for 0.0 (patch by "jeng", mantis #16863)

git-svn-id: trunk@15543 -
This commit is contained in:
Jonas Maebe 2010-07-10 12:15:13 +00:00
parent b3ca47e88a
commit 26cc281390
3 changed files with 16 additions and 0 deletions

1
.gitattributes vendored
View File

@ -10527,6 +10527,7 @@ tests/webtbs/tw16803.pp svneol=native#text/plain
tests/webtbs/tw1681.pp svneol=native#text/plain
tests/webtbs/tw16820.pp svneol=native#text/plain
tests/webtbs/tw16861.pp svneol=native#text/plain
tests/webtbs/tw16863.pp svneol=native#text/plain
tests/webtbs/tw16874.pp svneol=native#text/plain
tests/webtbs/tw1696.pp svneol=native#text/plain
tests/webtbs/tw1699.pp svneol=native#text/plain

View File

@ -1403,6 +1403,13 @@ function fpc_int64_to_double(i : int64): double; compilerproc;
exponent : word;
begin
{ check for zero }
if r[0]=0 then
begin
real2double:=0.0;
exit;
end;
{ copy mantissa }
res[0]:=0;
res[1]:=r[1] shl 5;

8
tests/webtbs/tw16863.pp Normal file
View File

@ -0,0 +1,8 @@
var
d : double;
r : real48 = ($0, $0, $0, $0, $0, $0);
BEGIN
d := r;
if d<>0.0 then
halt(1);
END.