On 2/27/19, Jim Borden <jim.bor...@couchbase.com> wrote:
>
> My theory as to why this varies by platform is because of the use of long
> double during this calculation, which can vary in size.  On the failing
> platforms they are the same size as regular double.  This results in a
> rounding error of the "scale" portion of the calculation (via sqlite3Pow10)
> which results in a false infinity.

Just out of curiosity, what platforms are you having trouble with.  I
tried the script below on each of Linux (Ubuntu with gcc 5.4.0), Mac
(LLVM 10.0.0), and Win10 (MSVC) and got the answer you expect in all
three cases, namely 1.79769313486231522322e+308,
8.98846567431157611547e+307, Inf.

SELECT quote(1.7976931348623153E+308);
SELECT quote(1.7976931348623153E+308/2.0);
SELECT quote(1.7976931348623153E+308*2.0);

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

Reply via email to