Re: IEEE 754 - Mailing list pgsql-hackers

From Mike Mascari
Subject Re: IEEE 754
Date
Msg-id 3FF08032.4050403@mascari.com
Whole thread Raw
In response to IEEE 754  (Sai Hertz And Control Systems <sank89@sancharnet.in>)
List pgsql-hackers
Sai Hertz And Control Systems wrote:

> Dear all ,
>
> I would like to share my concerns about the IEEE 754 specification and 
> floating point handling by PostgreSQL .
>
> Also I would like to learn how professional users of  PostgreSQL  work 
> with rounding of  monetary terms .
>
> If you would like to know whats IEEE 754 read this
> http://docs.sun.com/source/806-3568/ncg_goldberg.html

No sane human being would use floating point for monetary values. 
NUMERIC is an arbitrary precision type capable of effectively limitless 
scale and precision, although it is currently defined as having a limit 
of 1000:

#define NUMERIC_MAX_PRECISION 1000

As far as rounding is concerned, it depends on the application. For 
example, in the United States at least, each state has devised their own 
rounding rules with respect to sales and use taxes. For a look at how 
very bad sausage is made:

http://www.ecommercetax.com/official_docs/SSTP%20-%20Rounding.pdf

Mike Mascari
mascarm@mascari.com




pgsql-hackers by date:

Previous
From: Sai Hertz And Control Systems
Date:
Subject: IEEE 754
Next
From: Jan Wieck
Date:
Subject: Re: IEEE 754