2 bugs regarding infity values of REAL type

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

2 bugs regarding infity values of REAL type

Wouter Vegter
--
-- bug1:
select cast(cast(1.7976931348623157e+308 as text) as real);     --
1.7976931348623157e+308 is internally formatted&rounded as
1.79769313486232e+308 which >then< is bigger than REAL.max_value so it is
parsed as 'Inf'
-- expected: 1.7976931348623157e+308
-- actual output: Inf
--
-- bug2:
select cast(cast(1.7976931348623157e+311 as text) as real);     --
1.7976931348623157e+311 is internally recognized as Inf, but the
textual-format 'Inf' is not a valid real-format, so it is parsed as '0.0'
-- expected output: Inf
-- actual output: 0.0
--
-- suggested fix1:
-- make textual formatting of real values contain 16 decimal digits instead
of 14
-- suggested fix2:
-- make this regex parse infinity values: ^[+\-]?Inf$
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users