Re: BUG #5484: sum() bug

From: viras <viras(at)yandex(dot)ru>
To: Kevin Grittner <kevin(dot)grittner(at)wicourts(dot)gov>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5484: sum() bug
Date: 2010-06-02 05:13:37
Message-ID: 121691275455617@web48.yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Many thanks for the help!
numeric is my choice :)

01.06.10, 19:19, "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>:

> Robert Haas wrote:
> > On Tue, Jun 1, 2010 at 9:24 AM, viras wrote:
>
> >> What type of the data is better for using? Numbers up to 100000
> >> and accuracy of 2 fractional signs.
> >
> > numeric is a good choice to avoid loss of precision, but can be a
> > bit slower.
> >
> > You could also try float8.
>
> Yeah, as long as you remember that this is an *approximate* data
> type. If you really mean that you're satisfied with an *accuracy*
> of two fractional digits for a number up to 100000, you are OK. But
> realize that means that 1.01 would actually be
> 1.0100000000000000088817841970012523233890533447265625 and that
> 100000.01 would actually be
> 100000.009999999994761310517787933349609375 -- accurate to far more
> than two decimal digits, but not *exact*.
>
> If you want exact values based on decimal fractions, you should use
> numeric.
>
> -Kevin
>
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Takahiro Itagaki 2010-06-02 06:46:41 Re: [BUGS] BUG #5487: dblink failed with 63 bytes connection names
Previous Message Kevin Grittner 2010-06-01 15:19:07 Re: BUG #5484: sum() bug