mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 13:19:12 +02:00
* made application of rounding correction more accurate
(does *not* resolve #14230) git-svn-id: trunk@13494 -
This commit is contained in:
parent
8e9e7f0f8c
commit
30bfca91a9
@ -367,8 +367,11 @@ begin
|
||||
for fracCount := 1 to currPrec do
|
||||
factor := factor * 10.0;
|
||||
corrval := corrval / factor;
|
||||
{ d is currently in [0.0,1.0[ and roundcorr has been chosen so that
|
||||
1.0+roundcorr <> 1.0 -> add d*roundcorr to d to scale the correction
|
||||
to the actual value of d }
|
||||
if (d<>0.0) then
|
||||
d:=d+roundCorr;
|
||||
d:=d+d*roundCorr;
|
||||
if d >= corrVal then
|
||||
d := d + corrVal;
|
||||
if int(d) = 1 then
|
||||
|
Loading…
Reference in New Issue
Block a user