Jerry wrote on Wed, 23 Jan 2008 20:27:37 -0800:
JWL> In all versions, ROUND(x,0) and MROUND(x,1) produce
JWL> similar, but not identical results. Both approaches were
JWL> probably intended to deal with the fact that the intended
JWL> rounding rule does not translate exactly into binary.
JWL> Both approaches can unexpectedly round incorrectly.
JWL> ROUND appears to round based on Excel’s 15-digit decimal
JWL> display of the value to be rounded; and so is impacted by
JWL> Excel display bugs such as
JWL>
http://support.microsoft.com/kb/161234 which affects
hundreds of thousands of decimal
JWL> fractions, not just the one mentioned in the knowledge
JWL> base article. For instance, =ROUND(10^14+0.5,0)
JWL> incorrectly returns the value of 100000000000000 to match
JWL> Excel’s incorrect 15 digit display of the original number,
JWL> but =ROUND(0.499999999999995,0) correctly returns 0.
JWL> MROUND appears round directly from the binary value, but
JWL> uses too large a fuzz factor for identifying the branch
JWL> condition of 5 in the first figure to be rounded away.
JWL> Thus =MROUND(10^14+0.5,1) correctly returns
JWL> 100000000000001 but =MROUND(0.499999999999995,1)
JWL> incorrectly returns 1 instead of 0.
This is all very interesting but ultimately what does it matter
if ROUND sometimes goes in the wromg direction at the limits of
precision? It is hard for me to imagine a real case where so
many figures are necessary but I am ready to be instructed.
James Silverton
Potomac, Maryland
E-mail, with obvious alterations:
not.jim.silverton.at.verizon.not