<br><br>On Friday, August 19, 2011, Brandon Allbery <<a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a>> wrote:<br>> On Fri, Aug 19, 2011 at 11:45, Erik Hesselink <<a href="mailto:hesselink@gmail.com">hesselink@gmail.com</a>> wrote:<br>
>><br>>> Note that PostgreSQL also doesn't work with decimals as precision:<br>>><br>>> postgres=# select 1::decimal(4,2) * 1::decimal(4,2);<br>>> ?column?<br>>> ----------<br>>> 1.0000<br>
>> (1 row)<br>>><br>>> That should be 1.00 instead if you want the precision correctly represented.<br>><br>> 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'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>><br>> --<br>
> brandon s allbery <a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a><br>> wandering unix systems administrator (available) (412) 475-9364 <tel:%28412%29%20475-9364> vm/sms<br>
><br>>