mirror of
https://github.com/marzer/tomlplusplus.git
synced 2026-01-19 04:52:09 +00:00
Fixed undefined behavior with log10 cast of fractional doubles (#276)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user