mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 07:23:48 +02:00
* (non-ancient) Delphi versions that accept explicit ordinal -> floating
point typecasts behave the same as FPC (convert the value) rather than as Turbo Pascal (reinterpret the bit pattern) (mantis #35886) git-svn-id: trunk@42507 -
This commit is contained in:
parent
62ee766b42
commit
1da43f67d4
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -17770,6 +17770,7 @@ tests/webtbs/tw3578.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw3579.pp svneol=native#text/plain
|
tests/webtbs/tw3579.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3583.pp svneol=native#text/plain
|
tests/webtbs/tw3583.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw35862.pp svneol=native#text/pascal
|
tests/webtbs/tw35862.pp svneol=native#text/pascal
|
||||||
|
tests/webtbs/tw35886.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3589.pp svneol=native#text/plain
|
tests/webtbs/tw3589.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3594.pp svneol=native#text/plain
|
tests/webtbs/tw3594.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3595.pp svneol=native#text/plain
|
tests/webtbs/tw3595.pp svneol=native#text/plain
|
||||||
|
@ -808,9 +808,9 @@ implementation
|
|||||||
case def_from.typ of
|
case def_from.typ of
|
||||||
orddef :
|
orddef :
|
||||||
begin { ordinal to real }
|
begin { ordinal to real }
|
||||||
{ only for implicit and internal typecasts in tp/delphi }
|
{ only for implicit and internal typecasts in tp }
|
||||||
if (([cdo_explicit,cdo_internal] * cdoptions <> [cdo_explicit]) or
|
if (([cdo_explicit,cdo_internal] * cdoptions <> [cdo_explicit]) or
|
||||||
([m_tp7,m_delphi] * current_settings.modeswitches = [])) and
|
(not(m_tp7 in current_settings.modeswitches))) and
|
||||||
(is_integer(def_from) or
|
(is_integer(def_from) or
|
||||||
(is_currency(def_from) and
|
(is_currency(def_from) and
|
||||||
(s64currencytype.typ = floatdef))) then
|
(s64currencytype.typ = floatdef))) then
|
||||||
|
17
tests/webtbs/tw35886.pp
Normal file
17
tests/webtbs/tw35886.pp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
program project1;
|
||||||
|
|
||||||
|
{$mode delphi}
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils;
|
||||||
|
|
||||||
|
var
|
||||||
|
f: Double;
|
||||||
|
n: Int64;
|
||||||
|
|
||||||
|
begin
|
||||||
|
n := 9876543210;
|
||||||
|
f := Double(n);
|
||||||
|
if f<>9876543210.0 then
|
||||||
|
halt(1);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user