|
|
||
|
From a decimal perspective the binary rounding seems strange.Especially if the representation is not exact, one has to trustthe hidden "round to nearest“ function as one can see in thefollowing example.
-- testn={6.05,6.15,6.25,6.35,6.45,6.55,6.65,6.75,6.85,6.95}
for i = 1,#n dox = string.format("%.1f",n[i])print(n[i].." "..x.." "..(x-n[i]))end
-- output6.05 6.0 -0.056.15 6.2 0.056.25 6.2 -0.056.35 6.3 -0.056.45 6.5 0.056.55 6.5 -0.056.65 6.7 0.056.75 6.8 0.056.85 6.8 -0.056.95 7.0 0.05
Nevertheless it is the right way to round with as less bias as possible.So i agree with you, that it's a feature and not a bug. Thx for thepatience and explanations.
Thomas