mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 14:08:05 +02:00
* Evaluate currency constant expressions when the currency type is 64-bit integer. Issue #28749.
git-svn-id: trunk@33334 -
This commit is contained in:
parent
12bf033606
commit
d4d70d3865
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -14924,6 +14924,7 @@ tests/webtbs/tw28718b.pp svneol=native#text/plain
|
||||
tests/webtbs/tw28718c.pp svneol=native#text/plain
|
||||
tests/webtbs/tw28718d.pp svneol=native#text/plain
|
||||
tests/webtbs/tw28748.pp svneol=native#text/plain
|
||||
tests/webtbs/tw28749.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2876.pp svneol=native#text/plain
|
||||
tests/webtbs/tw28766.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw28801.pp svneol=native#text/plain
|
||||
|
@ -437,6 +437,10 @@ implementation
|
||||
(lt in [pointerconstn,niln]) and
|
||||
(rt in [pointerconstn,niln]) and
|
||||
(nodetype in [ltn,lten,gtn,gten,equaln,unequaln,subn])
|
||||
) or
|
||||
(
|
||||
(lt = ordconstn) and (ld.typ = orddef) and is_currency(ld) and
|
||||
(rt = ordconstn) and (rd.typ = orddef) and is_currency(rd)
|
||||
) then
|
||||
begin
|
||||
t:=nil;
|
||||
|
14
tests/webtbs/tw28749.pp
Normal file
14
tests/webtbs/tw28749.pp
Normal file
@ -0,0 +1,14 @@
|
||||
uses
|
||||
SysUtils;
|
||||
var
|
||||
s: string;
|
||||
c: currency;
|
||||
begin
|
||||
c:=Currency(0.12) + Currency(0.14);
|
||||
s:=CurrToStr(c);
|
||||
s:=StringReplace(s, FormatSettings.DecimalSeparator, '.', []);
|
||||
writeln('s=', s);
|
||||
if s <> '0.26' then
|
||||
Halt(1);
|
||||
writeln('OK');
|
||||
end.
|
Loading…
Reference in New Issue
Block a user