<br><br>On Friday, August 19, 2011, Brandon Allbery &lt;<a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a>&gt; wrote:<br>&gt; On Fri, Aug 19, 2011 at 11:45, Erik Hesselink &lt;<a href="mailto:hesselink@gmail.com">hesselink@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>&gt;&gt; Note that PostgreSQL also doesn&#39;t work with decimals as precision:<br>&gt;&gt;<br>&gt;&gt; postgres=# select 1::decimal(4,2) * 1::decimal(4,2);<br>&gt;&gt; ?column?<br>&gt;&gt; ----------<br>&gt;&gt;   1.0000<br>
&gt;&gt; (1 row)<br>&gt;&gt;<br>&gt;&gt; That should be 1.00 instead if you want the precision correctly represented.<br>&gt;<br>&gt; Er?  Last I checked, that was exactly how precision worked over multiplication; otherwise you are incorrectly discarding precision present in the original values.  Unless you&#39;re assuming the OP actually wants an incorrect flat precision model....<br>
<br>This is the way I was taught to do it in physics. See also <a href="http://en.m.wikipedia.org/wiki/Significance_arithmetic">http://en.m.wikipedia.org/wiki/Significance_arithmetic</a> <br><br>Erik<br><br>&gt;<br>&gt; --<br>
&gt; brandon s allbery                                      <a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a><br>&gt; wandering unix systems administrator (available)     (412) 475-9364 &lt;tel:%28412%29%20475-9364&gt; vm/sms<br>
&gt;<br>&gt;