This commit is contained in:
Jean Disset 2016-03-30 18:23:27 +00:00
commit 8ef7a32e37
2 changed files with 6 additions and 6 deletions

View File

@ -6048,10 +6048,10 @@ class basic_json
{
// If the number is an integer then output as a fixed with with
// precision 1 to output "0.0", "1.0" etc as expected for some
// round trip tests otherwise 15 digits of precision allows
// round trip tests otherwise 17 digits of precision allows
// round-trip IEEE 754 string->double->string; to be safe, we
// read this value from
// std::numeric_limits<number_float_t>::digits10
// std::numeric_limits<number_float_t>::max_digits10
if (std::fmod(m_value.number_float, 1) == 0)
{
o << std::fixed << std::setprecision(1);
@ -6060,7 +6060,7 @@ class basic_json
{
// std::defaultfloat not supported in gcc version < 5
o.unsetf(std::ios_base::floatfield);
o << std::setprecision(std::numeric_limits<double>::digits10);
o << std::setprecision(std::numeric_limits<double>::max_digits10);
}
o << m_value.number_float;
return;

View File

@ -6048,10 +6048,10 @@ class basic_json
{
// If the number is an integer then output as a fixed with with
// precision 1 to output "0.0", "1.0" etc as expected for some
// round trip tests otherwise 15 digits of precision allows
// round trip tests otherwise 17 digits of precision allows
// round-trip IEEE 754 string->double->string; to be safe, we
// read this value from
// std::numeric_limits<number_float_t>::digits10
// std::numeric_limits<number_float_t>::max_digits10
if (std::fmod(m_value.number_float, 1) == 0)
{
o << std::fixed << std::setprecision(1);
@ -6060,7 +6060,7 @@ class basic_json
{
// std::defaultfloat not supported in gcc version < 5
o.unsetf(std::ios_base::floatfield);
o << std::setprecision(std::numeric_limits<double>::digits10);
o << std::setprecision(std::numeric_limits<double>::max_digits10);
}
o << m_value.number_float;
return;