Graham Leggett wrote:
Jan Wieck wrote:

You won't get any rounding errors in NUMERIC either. What people should be concerned of is to find an arbitrary precision package for the frontend programming language they're using.

What is the definition of a numeric number? I understand (from studying numeric methods all those years ago) that the base 10 decimal number 0.1 cannot be stored exactly in base 2 floating point, thus my use of integers - is numeric an arbitrary precision concept?

The PostgreSQL datatype NUMERIC is performing decimal arithmetic. The original I wrote used to do it string based, with one digit per byte but stored the number as some sort of BCD, one digit per nibble. Tom Lane changed that a while back into base 10,000 storage and calculation, which has the advantages of doing 4 digits per loop and no need to convert back and forth between the storage and the computational representation.



Jan


--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== [EMAIL PROTECTED] #


---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

Reply via email to