Re: [BUGS] BUG #5150: math bug

2009-11-01 Thread Mark Kirkwood
David Fetter wrote: On Fri, Oct 30, 2009 at 08:51:57PM -0700, John R Pierce wrote: Tom Lane wrote: There is special-purpose software out there that can compute exactly with rational numbers, but you aren't likely to find it embedded in any general-purpose tools like databases --- the us

Re: [BUGS] BUG #5150: math bug

2009-10-31 Thread Robert Haas
On Fri, Oct 30, 2009 at 11:51 PM, John R Pierce wrote: > Tom Lane wrote: >> >> There is special-purpose software out there that can compute exactly >> with rational numbers, but you aren't likely to find it embedded in any >> general-purpose tools like databases --- the use-case just isn't wide >>

Re: [BUGS] BUG #5150: math bug

2009-10-30 Thread David Fetter
On Fri, Oct 30, 2009 at 08:51:57PM -0700, John R Pierce wrote: > Tom Lane wrote: >> There is special-purpose software out there that can compute >> exactly with rational numbers, but you aren't likely to find it >> embedded in any general-purpose tools like databases --- the >> use-case just isn't

Re: [BUGS] BUG #5150: math bug

2009-10-30 Thread John R Pierce
Tom Lane wrote: There is special-purpose software out there that can compute exactly with rational numbers, but you aren't likely to find it embedded in any general-purpose tools like databases --- the use-case just isn't wide enough. One reason why not is that it'll still fall down on irrationa

Re: [BUGS] BUG #5150: math bug

2009-10-30 Thread Tom Lane
Robert Haas writes: > In general, floating point arithmetic is inaccurate and sucky. That > has nothing to do with PostgreSQL; it's just life. Actually, I think these examples are being done in "numeric" not float8. Your comment stands though --- 1.0/3.0 does not give the exact rational number 1

Re: [BUGS] BUG #5150: math bug

2009-10-30 Thread Robert Haas
On Fri, Oct 30, 2009 at 1:39 AM, Gray wrote: > > The following bug has been logged online: > > Bug reference:      5150 > Logged by:          Gray > Email address:      g...@ms-irk.ru > PostgreSQL version: 8.2.6 > Operating system:   i686-pc-linux-gnu > Description:        math bug > Details: > >

[BUGS] BUG #5150: math bug

2009-10-30 Thread Gray
The following bug has been logged online: Bug reference: 5150 Logged by: Gray Email address: g...@ms-irk.ru PostgreSQL version: 8.2.6 Operating system: i686-pc-linux-gnu Description:math bug Details: select 1/3*3,(1.0/3.0)*3.0,floor((1.0/3.0)*3.0); returns 0, 1, 0