"Patric Bechtel" <[EMAIL PROTECTED]> writes: > Maybe you want to have a look here: > http://www2.hursley.ibm.com/decimal/DPDecimal.html
Well we're not really looking for the optimal packing in general. All the problems here have to do with convenience in the implementation rather than the problems with the approach. It's easier in the code to have fixed size scale and weight and to have them at the beginning of the data type, which is fine for larger values but for small values they dominate and waste space. But as far as the approach goes, I admit I find it a bit hard to believe that we're still doing BCD in the 21st century at all. If we stored the digits in base 2 with a base 10 exponent would it really be too hard to output the digits? Even long multiplication and then reversing the results doesn't seem like it would be too bad and surely there must exist reasonable algorithms to do better. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org