summaryrefslogtreecommitdiff
path: root/core/ustring.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-07-25 18:54:25 +0200
committerGitHub <noreply@github.com>2020-07-25 18:54:25 +0200
commit6f292f906e749f30ceb7f922df5639add61a5f88 (patch)
treeb644dba35d501c40bd144c767351822f0290b9fa /core/ustring.cpp
parent58bde149cc461b5fafa254f765ad370a7291ffb5 (diff)
parent0181c3dde12d2bcfdcbb463dcf90cf47f0b88fee (diff)
Merge pull request #38900 from bruvzg/docs_ignore_os_spec_def_vals
Docs: Ignore OS specific values (constants, project settings, properties)
Diffstat (limited to 'core/ustring.cpp')
-rw-r--r--core/ustring.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 5d3cf5f1a4..572ad1af59 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -1025,6 +1025,9 @@ String String::chr(CharType p_char) {
}
String String::num(double p_num, int p_decimals) {
+ if (Math::is_nan(p_num)) {
+ return "nan";
+ }
#ifndef NO_USE_STDLIB
if (p_decimals > 16) {
@@ -1313,6 +1316,9 @@ String String::num_real(double p_num) {
}
String String::num_scientific(double p_num) {
+ if (Math::is_nan(p_num)) {
+ return "nan";
+ }
#ifndef NO_USE_STDLIB
char buf[256];