1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

MetaDataRef: Make set_float preserve numbers exactly (#16090)

This commit is contained in:
Lars Müller 2025-05-02 21:27:00 +02:00 committed by GitHub
parent 6f3735281f
commit d96f5e1c76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 92 additions and 12 deletions

View file

@ -465,6 +465,10 @@ inline std::string ftos(float f)
return oss.str();
}
/// @brief Converts double to string. Handles high precision and inf/nan.
std::string my_double_to_string(double number);
/// @brief Converts string to double. Handles high precision and inf/nan.
std::optional<double> my_string_to_double(const std::string &s);
/**
* Replace all occurrences of \p pattern in \p str with \p replacement.