* fix for lost precision because sometimes the correction value was

larger than the number to be corrected
  * incompatibility with TP's output fixed
This commit is contained in:
Jonas Maebe 2000-02-26 18:53:11 +00:00
parent 0b02714817
commit 51bbb51a06

View File

@ -286,8 +286,8 @@ begin
end; end;
{ adjust the precision depending on how many digits we already } { adjust the precision depending on how many digits we already }
{ "processed" by multiplying by 10 } { "processed" by multiplying by 10 }
if currPrec >= abs(Correct) then { if currPrec >= abs(Correct) then
currPrec := currPrec - abs(correct)+1; currPrec := currPrec - abs(correct)+1;}
end; end;
{ current length of the output string in endPos } { current length of the output string in endPos }
endPos := spos; endPos := spos;
@ -305,7 +305,8 @@ begin
corrVal := 0.5; corrVal := 0.5;
for fracCount := 1 to currPrec do for fracCount := 1 to currPrec do
corrVal := corrVal / 10.0; corrVal := corrVal / 10.0;
d := d + corrVal; if d > corrVal then
d := d + corrVal;
end; end;
{ 0.0 < d < 1.0 if we didn't round of earlier, otherwise 1 < d < 10 } { 0.0 < d < 1.0 if we didn't round of earlier, otherwise 1 < d < 10 }
if d < 1.0-roundCorr then if d < 1.0-roundCorr then
@ -375,7 +376,12 @@ end;
{ {
$Log$ $Log$
Revision 1.23 2000-02-26 15:49:40 jonas Revision 1.24 2000-02-26 18:53:11 jonas
* fix for lost precision because sometimes the correction value was
larger than the number to be corrected
* incompatibility with TP's output fixed
Revision 1.23 2000/02/26 15:49:40 jonas
+ new str_real which is completely TP compatible regarding output + new str_real which is completely TP compatible regarding output
format and which should have no rounding errors anymore format and which should have no rounding errors anymore