summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/basic_functions.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 28a26b5948..6cb1a6f422 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -957,9 +957,10 @@ PHPAPI double php_get_nan()
((php_uint32*)&val)[1] = PHP_DOUBLE_QUIET_NAN_HIGH;
((php_uint32*)&val)[0] = 0;
return val;
-#else
- /* hope the target platform is ISO-C compliant */
+#elif defined(HAVE_ATOF_ACCEPTS_NAN)
return atof("NAN");
+#else
+ return 0.0/0.0;
#endif
}
@@ -970,9 +971,10 @@ PHPAPI double php_get_inf()
((php_uint32*)&val)[1] = PHP_DOUBLE_INFINITY_HIGH;
((php_uint32*)&val)[0] = 0;
return val;
-#else
- /* hope the target platform is ISO-C compliant */
+#elif defined(HAVE_ATOF_ACCEPTS_INF)
return atof("INF");
+#else
+ return 1.0/0.0;
#endif
}