On Tue, Jul 10, 2012 at 11:33 AM, Igor Tandetnik <itandet...@mvps.org>wrote:

> On 7/10/2012 11:24 AM, Ryan Johnson wrote:
>
>> On 10/07/2012 9:58 AM,
>> bardzotajneko...@interia.pl wrote:
>>
>>> SQLite version 4.0.0 2012-07-07 12:21:48
>>> Enter ".help" for instructions
>>> Enter SQL statements terminated with a ";"
>>> sqlite> create table t(a);
>>> sqlite> insert into t values(123);
>>> sqlite> insert into t values(123.0);
>>> sqlite> insert into t values(12323);
>>> sqlite> insert into t values(12323.0);
>>> sqlite> select * from t group by 1;
>>> 123.0
>>> 12323
>>> 12323.0
>>> sqlite>
>>>
>> This is correct: 123 != 123.0 != "123" because they all have different
>> types (int/float/string).
>>
>
> Could you explain why 123 and 123.0 got grouped together, but 12323 and
> 12323.0 did not? Shouldn't the same logic apply? It's this inconsistency
> that looks qutie suspicious.
>

SQLite4 is still using "double" internally for floating point
computations.  (Yes, there are plans to change that but it has not happened
yet.)  The bug above is due to rounding errors in the doubles, specifically
rounding errors that occur when doing the key encoding.


> --
> Igor Tandetnik
>
>
> ______________________________**_________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users>
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to