Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions include/boost/json/basic_parser_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ dec_to_float(
if(neg)
x = -x;

// pow10 returns infinity for large exponents,
// and zero times infinity is NaN
if(m == 0)
return x;

if(e < -305)
{
x *= 1e-305 ;
Expand Down
2 changes: 2 additions & 0 deletions test/double.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ class double_test
grind_double("-0.010", -0.01);
grind_double("-0.0", -0.0);
grind_double("-0e0", -0.0);
grind_double( "0e400", 0.0);
grind_double("-0e400", -0.0);
grind_double( "18.4", 18.4);
grind_double("-18.4", -18.4);
grind_double( "18446744073709551616", 1.8446744073709552e+19);
Expand Down
Loading