1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-25 15:37:42 +00:00

Revert "Handle NaN and Infinity in JSON stringify function"

This commit is contained in:
Clay John
2025-10-10 18:22:24 -07:00
committed by GitHub
parent 16a11ac88b
commit 8b06cdf277
2 changed files with 0 additions and 33 deletions

View File

@@ -76,17 +76,6 @@ void JSON::_stringify(String &r_result, const Variant &p_var, const String &p_in
case Variant::FLOAT: {
const double num = p_var;
// JSON does not support NaN or Infinity, so use extremely large numbers for infinity.
if (!Math::is_finite(num)) {
if (num == Math::INF) {
r_result += "1e99999";
} else if (num == -Math::INF) {
r_result += "-1e99999";
} else {
r_result += "\"NaN\"";
}
return;
}
// Only for exactly 0. If we have approximately 0 let the user decide how much
// precision they want.
if (num == double(0.0)) {