If I understand you correctly, I think that won't make any
difference.
It does in many cases, if used correctly.
I'm sure it won't once you assign 115/100 to a variable;
That's the incorrect way
.
What I meant when I suggested that (and I think I already wrote that,
but I probably wasn't clear enough), is to use terms like 115 / 100 in
an expression:
my $x = 5830;
my $y = $x * 115 / 100;
will first compute the product of 5830 and 115 (which is 670450) and
then divide it by 100. The result is exactly 6704.5.
my $y = $x * (115 / 100);
will first compute 115 / 100: This is exactly representable in a finite
binary number, so it is rounded (to 53 binary digits, usually). Then $x
is divided by the rounded number, which is of course only approximately
6704.5.
Variations like
my $y = $x * 1.15;
or
my $z = 115 / 100;
my $y = $x * $z;
do the same, so they produce the same error.
[...]
For some sets of data, yes.
If I understood the question correctly, no. The "statistically
interesting way to round" is just a way to deal with the errors
introduced by rounding in general. As the Wikipedia article mentions, it
was already the recommended way of rounding in 1906 - long before
computers. (Although it is true that if you used infinitely precise
numbers and if your functions were all continous, the error would be
infinitely small - so in a way it is the "uncorrectness of floating
point numbers" which is the reason for the rule).
hp