diff options
| -rw-r--r-- | include/toml++/impl/toml_formatter.inl | 2 | ||||
| -rw-r--r-- | toml.hpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/include/toml++/impl/toml_formatter.inl b/include/toml++/impl/toml_formatter.inl index 201de9ce9e..8b4f633dca 100644 --- a/include/toml++/impl/toml_formatter.inl +++ b/include/toml++/impl/toml_formatter.inl @@ -91,7 +91,7 @@ TOML_ANON_NAMESPACE_START weight += 1u; val *= -1.0; } - return weight + static_cast<size_t>(log10(val)) + 1u; + return weight + static_cast<size_t>(abs(log10(val))) + 1u; } case node_type::boolean: return 5u; @@ -17107,7 +17107,7 @@ TOML_ANON_NAMESPACE_START weight += 1u; val *= -1.0; } - return weight + static_cast<size_t>(log10(val)) + 1u; + return weight + static_cast<size_t>(abs(log10(val))) + 1u; } case node_type::boolean: return 5u; |
