<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=103555817-08012007>Alexander Haarer writes:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=103555817-08012007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV>1.10*1.10 => 1.2100<BR><BR>suggests, that the precision of the result
would be higher than the precision<BR>of the source values - but this is just
wrong, because the relative errors<BR>of the source values sum up in a
multiplication operation. <BR><BR>That means the relative error of the result is
always bigger. Following<BR>the argumentation of the mentioned web link, this
should result in less<BR>significant digits, but not in more significant
digits.<BR><BR>Personally, i dont like the style of enconding precision into
digits, because<BR>it restricts to discrete steps of precision values.
<BR><BR>IMO, most other reasons in the web link are only valid if user
presentation<BR>requirements and internal data representation requirements are
mixed up.<BR>(which IMO is bad idea)<BR><SPAN class=103555817-08012007><FONT
face=Arial color=#0000ff size=2></FONT></SPAN></DIV><SPAN
class=103555817-08012007>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=103555817-08012007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=103555817-08012007>Alexander,</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV></SPAN><SPAN class=103555817-08012007><FONT face=Arial color=#0000ff
size=2>Yes, that's a good point. I see I wasn't addressing Luke's specific
example, more the basic question of where trailing zeros are
useful.</FONT></SPAN></DIV>
<DIV><SPAN class=103555817-08012007><FONT face=Arial color=#0000ff size=2><SPAN
class=103555817-08012007></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN class=103555817-08012007><FONT face=Arial color=#0000ff size=2><SPAN
class=103555817-08012007>I think the link below (and example adding 1 and 0.001)
explains their reasoning: the idea is to treat the calculation as
exact:</SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=103555817-08012007><FONT face=Arial color=#0000ff size=2><SPAN
class=103555817-08012007></SPAN></FONT></SPAN> </DIV>
<DIV><SPAN class=103555817-08012007><FONT><SPAN class=103555817-08012007><FONT
face=Arial color=#0000ff size=2>"Given that an addition operator does <I>not</I>
know whether a number is a measurement or an exact quantity then it has no
option other than to return the exact answer (the fourth case). How this result
is interpreted is up to the application, and that application is at liberty to
apply some rounding rule or to treat the result as exact, as appropriate.
</FONT>
<P><FONT face=Arial><FONT color=#0000ff><FONT size=2>So, default operations must
treat calculations as exact.<SPAN
class=103555817-08012007> " </SPAN></FONT></FONT></FONT></P>
<P><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=103555817-08012007>There's the reasoning, but I'd agree with your point,
that if it is exact, I should have to specify that, i.e. "1.000", or
"1".setExact(). It seems they have it defaulting the wrong way - another
example is in Java you have the option of:</SPAN></FONT></FONT></FONT></P>
<P><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=103555817-08012007>decimalVal1.multiply(decimalVal2).stripTrailingZeros();</SPAN></FONT></FONT></FONT></P>
<P><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=103555817-08012007>Where I should have to specify
"keepTrailingZeros()"
instead.</SPAN></FONT></FONT></FONT></P></SPAN></FONT></SPAN></DIV>
<DIV><SPAN class=103555817-08012007>
<DIV><FONT color=#0000ff><A
href="http://www2.hursley.ibm.com/decimal/decifaq4.html#signif"><FONT face=Arial
size=2>http://www2.hursley.ibm.com/decimal/decifaq4.html#signif</FONT></A><SPAN
class=103555817-08012007><FONT face=Arial
size=2> </FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=103555817-08012007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=103555817-08012007>Well,
I will say it's not perfect, but better than it was, see Kahan's page here for
some funny tricks Excel, Java, Matlab, and even compilers can
play:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=103555817-08012007><A
href="http://www.cs.berkeley.edu/~wkahan/">http://www.cs.berkeley.edu/~wkahan/</A></SPAN></FONT></DIV>
<DIV><FONT color=#0000ff><SPAN
class=103555817-08012007></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff><SPAN
class=103555817-08012007></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff><SPAN
class=103555817-08012007> </SPAN></FONT></DIV> </SPAN></DIV><BR><BR></BODY></HTML>