summaryrefslogtreecommitdiff
path: root/Zend/zend_strtod.c
diff options
context:
space:
mode:
authorChristian Seiler <cseiler@php.net>2008-12-02 16:19:10 +0000
committerChristian Seiler <cseiler@php.net>2008-12-02 16:19:10 +0000
commit04c528609a1849d19bed744f9f2bfcc0b7eab0ae (patch)
tree32cfba471ba64799c8380ae49bc6ffccd9c17c2e /Zend/zend_strtod.c
parentd5295fc9c83013b8eabcdf4d9f3b8a2c250575e4 (diff)
downloadphp-git-04c528609a1849d19bed744f9f2bfcc0b7eab0ae.tar.gz
- MFH: Changed floating point behaviour to consistently use double precision
on all platforms and with all compilers.
Diffstat (limited to 'Zend/zend_strtod.c')
-rw-r--r--Zend/zend_strtod.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c
index bc2ca97b19..4a3e976d25 100644
--- a/Zend/zend_strtod.c
+++ b/Zend/zend_strtod.c
@@ -93,6 +93,7 @@
#include <zend_operators.h>
#include <zend_strtod.h>
+#include <zend_float.h>
#ifdef ZTS
#include <TSRM.h>
@@ -2032,6 +2033,7 @@ ret1:
ZEND_API double zend_strtod (CONST char *s00, char **se)
{
+ ZEND_FLOAT_DECLARE
int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign,
e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
CONST char *s, *s0, *s1;
@@ -2044,6 +2046,8 @@ ZEND_API double zend_strtod (CONST char *s00, char **se)
CONST char decimal_point = '.';
+ ZEND_FLOAT_ENSURE();
+
sign = nz0 = nz = 0;
value(rv) = 0.;
@@ -2574,7 +2578,7 @@ ret:
}
_THREAD_PRIVATE_MUTEX_UNLOCK(pow5mult_mutex);
- return result;
+ ZEND_FLOAT_RETURN(result);
}
ZEND_API double zend_hex_strtod(const char *str, char **endptr)