From 30bfca91a95c686ac980ec2eca13f95a3993e7b7 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Thu, 6 Aug 2009 20:41:43 +0000 Subject: [PATCH] * made application of rounding correction more accurate (does *not* resolve #14230) git-svn-id: trunk@13494 - --- rtl/inc/real2str.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rtl/inc/real2str.inc b/rtl/inc/real2str.inc index ab10700098..cf04e5c163 100644 --- a/rtl/inc/real2str.inc +++ b/rtl/inc/real2str.inc @@ -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