On 2/25/2013 10:53 AM, Eric Rubin-Smith wrote:
Minor typos aside, it's interesting that SQLite is nice enough to convert
integers strictly less than -1 * 2^63 to floats and then take the floating
absolute value.

There are no 64-bit signed integers (which is the only integral type SQLite deals with) less than -1 * 2^63. If you have a number like that, it must necessarily be of a floating point type to begin with. No conversion is taking place.

sqlite> select abs(-9223372036854775809);
9.22337203685478e+18

The conversion here is being performed by the SQL parser, which takes a sequence of characters "-9223372036854775809" and interprets it as a numeric literal representing a floating point number -9.22337203685478e+18 (note loss of precision).
--
Igor Tandetnik

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

Reply via email to