Re: [sqlite] Bug on real operations

2013-03-26 Thread Israel Lins Albuquerque
gt;> From: sqlite-users-boun...@sqlite.org >> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin >> Sent: Friday, March 08, 2013 1:37 PM >> To: General Discussion of SQLite Database >> Subject: Re: [sqlite] Bug on real operations >> >> >> On

Re: [sqlite] Bug on real operations

2013-03-10 Thread James K. Lowden
On Fri, 8 Mar 2013 15:06:31 -0300 Israel Lins Albuquerque wrote: > The problem is not comparisons the problem is when I do something > like this: CREATE TABLE tb (a REAL); > INSERT INTO tb (a) VALUES(0); > UPDATE tb SET a = a + 5.45; > UPDATE tb SET a = a + 16.9; > >

Re: [sqlite] Bug on real operations

2013-03-08 Thread Israel Lins Albuquerque
S SQL was conversion to smallmoney. > > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin > Sent: Friday, March 08, 2013 1:37 PM > To: General Discussion of SQLite Database > Subject: Re: [sqlite]

Re: [sqlite] Bug on real operations

2013-03-08 Thread Marc L. Allen
was conversion to smallmoney. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: Friday, March 08, 2013 1:37 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Bug on real operations On 8 Mar 2013

Re: [sqlite] Bug on real operations

2013-03-08 Thread Simon Slavin
On 8 Mar 2013, at 6:24pm, Israel Lins Albuquerque wrote: > I don't know how postgres handle this, may be I can check Postgres has special datatypes used especially to handle problems like this. It has both artbitrary precision and monetary datatypes. If you

Re: [sqlite] Bug on real operations

2013-03-08 Thread Israel Lins Albuquerque
I know that very well. I don't know how postgresql handle this, may be I can check, I just charring by problem to brainstorm if sqlite may do or not what postgresql do. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Bug on real operations

2013-03-08 Thread Simon Slavin
On 7 Mar 2013, at 6:03pm, Israel Lins Albuquerque wrote: > But in sqlite for some reason they are: > 3.5527136788005e-15, 0, -3.5527136788005e-15 > > I thing this can be a bug on calculation of doubles. Please read these:

Re: [sqlite] Bug on real operations

2013-03-08 Thread Israel Lins Albuquerque
n",d); >> printf("%e\n",d); >> } >> On both MS Visual C and gcc on a Linux system: >> 0.00 >> 3.55271e-015 >> 3.552714e-015 >> >> -Original Message- >> From: sqlite-users-boun...@sqlite.org >> [mailto:sqlit

Re: [sqlite] Bug on real operations

2013-03-08 Thread Michael Black
nuing. 22.35 22.35 2.235000e+001 2.235000e+001 -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Israel Lins Albuquerque Sent: Friday, March 08, 2013 12:07 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Bug

Re: [sqlite] Bug on real operations

2013-03-08 Thread Richard Hipp
On Fri, Mar 8, 2013 at 1:06 PM, Israel Lins Albuquerque < israelin...@yahoo.com.br> wrote: > The problem is not comparisons the problem is when I do something like > this: > CREATE TABLE tb (a REAL); > INSERT INTO tb (a) VALUES(0); > UPDATE tb SET a = a + 5.45; > UPDATE tb SET a = a + 16.9; >

Re: [sqlite] Bug on real operations

2013-03-08 Thread Michael Black
4), round((5.45 + 16.9) - 22.35,14); 0.0|1|0.0 -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Israel Lins Albuquerque Sent: Thursday, March 07, 2013 12:04 PM To: sqlite-users@sqlite.org Subject: [sqlite] Bug on real o

Re: [sqlite] Bug on real operations

2013-03-08 Thread Israel Lins Albuquerque
printf("%e\n",d); > } > On both MS Visual C and gcc on a Linux system: > 0.00 > 3.55271e-015 > 3.552714e-015 > > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Israel Lins > A

Re: [sqlite] Bug on real operations

2013-03-08 Thread Israel Lins Albuquerque
printf("%e\n",d); > } > On both MS Visual C and gcc on a Linux system: > 0.00 > 3.55271e-015 > 3.552714e-015 > > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Israel Lins > Albu

Re: [sqlite] Bug on real operations

2013-03-08 Thread Michael Black
ers-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Israel Lins Albuquerque Sent: Thursday, March 07, 2013 12:04 PM To: sqlite-users@sqlite.org Subject: [sqlite] Bug on real operations An example speaks more than words: Execute this: SELECT 22.35 - (5.45 + 16.9), 22.35 = (5

Re: [sqlite] Bug on real operations

2013-03-08 Thread Michael Black
n Behalf Of Israel Lins Albuquerque Sent: Thursday, March 07, 2013 12:04 PM To: sqlite-users@sqlite.org Subject: [sqlite] Bug on real operations An example speaks more than words: Execute this: SELECT 22.35 - (5.45 + 16.9), 22.35 = (5.45 + 16.9), (5.45 + 16.9) - 22.35; The expected result on almos

[sqlite] Bug on real operations

2013-03-08 Thread Israel Lins Albuquerque
An example speaks more than words: Execute this: SELECT 22.35 - (5.45 + 16.9), 22.35 = (5.45 + 16.9), (5.45 + 16.9) - 22.35; The expected result on almost databases is: 0.0, true or 1, 0.0 But in sqlite for some reason they are: 3.5527136788005e-15, 0, -3.5527136788005e-15 I thing this can be