On Friday, 13 December, 2019 18:35, Richard Damon <rich...@damon-family.org> 
wrote:

>One big thing to watch out is that columns of NUMERIC type can easily
>return values of either INTEGER or REAL type. Your single type
>expectation is easily broken here. I also don't know if
>9223372036854775807 (the biggest integer value) from an INTEGER field +
>1 gives a REAL result, or some incorrect INTEGER value.

The result is 9223372036854775807.9999999 which is the closest representable 
double precision floating point number.  Of course, you get the same answer 
unless you add 1025 instead of 1, in which case you get the next representable 
floating point number which is 9223372036854777855.9999999.  The arithmetic 
functions carry out the operations using the "type" of their arguments -- and 
if one of them is a float, then the other is converted to a float.  If both are 
integers and an overflow (or underflow) occurs, then both arguments are 
converted to floating point and the operation is carried out in floating point.

-- 
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.




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

Reply via email to