Igor Tandetnik wrote:
> eternelmangekyosharingan
> <eternelmangekyosharin...@gmail.com>
> wrote:  
>   
>> I create the following table:
>> sqlite> create table t1(a);
>> sqlite> insert into t1 values(123456789.123456789);
>>
>> I ran the following commands:
>> sqlite> select * from t1;
>> 123456789.123457
>> sqlite> select typeof(a) from t1;
>> real
>>
>> What I expected to get is:
>> sqlite> select * from t1;
>> 123456789.123456789
>> sqlite> select typeof(a) from t1;
>> text
>>
>> since the conversion of 123456789.123456789 to real induce some loss.
>>     
>
> http://www.sqlite.org/datatype3.html
> For conversions between TEXT and REAL storage classes, SQLite considers the 
> conversion to be lossless and reversible if the first 15 significant decimal 
> digits of the number are preserved.
>
> So no, by SQLite's definition, there is no loss.
>   
That definition doesn't work for denormals:

sqlite> CREATE TABLE T (x REAL);
sqlite> INSERT INTO T VALUES ('5.12345678901234567890e-324');
sqlite> SELECT x, TYPEOF(x) FROM T;
4.94065645841247e-324|real

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

Reply via email to