4 messages in com.mysql.lists.bugsRe: Queries on doubles are not stable| From | Sent On | Attachments |
|---|---|---|
| Alan G. Carter | 30 Nov 2000 14:11 | |
| Sasha Pachev | 01 Dec 2000 16:49 | |
| Thimble Smith | 02 Dec 2000 09:59 | |
| Michael Widenius | 03 Dec 2000 02:35 |
| Subject: | Re: Queries on doubles are not stable![]() |
|---|---|
| From: | Thimble Smith (ti...@mysql.com) |
| Date: | 12/02/2000 09:59:40 AM |
| List: | com.mysql.lists.bugs |
On Fri, Dec 01, 2000 at 05:49:45PM -0700, Sasha Pachev wrote:
On Thursday 30 November 2000 15:11, Alan G. Carter wrote:
/usr/local/mysql/bin/mysql -v -u root --password=$1 << EOF use mysql create table test_doubles (datum double);
insert into test_doubles values (0.5); insert into test_doubles values (1.0); insert into test_doubles values (1.5); insert into test_doubles values (2.0); insert into test_doubles values (2.5);
select * from test_doubles; select * from test_doubles where datum < 1.5; select * from test_doubles where datum > 1.5; select * from test_doubles where datum = 1.5; # # What happens with the bug is: # # 1) 5 rows # 2) 5 rows # 3) 0 rows # 4) 1 rows
The problem with double comparisons is that there is always a margin of error.
This would explain the problem if it were row 4 which were "incorrect". But it doesn't explain rows 2 and 3 being wrong.
Alan, I'm not aware of any changes between 3.23.25 and the current code that pertain to this - nor have I heard of this problem in 3.23.25 from anyone else. So, I'm not sure what is making the difference....
Tim
-- __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Tim Smith <ti...@mysql.com> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Development Team /_/ /_/\_, /___/\___\_\___/ Boone, NC USA <___/ www.mysql.com




