diff options
author | Zeev Suraski <zeev@php.net> | 2000-02-26 04:07:03 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2000-02-26 04:07:03 +0000 |
commit | 80782eff1f1612301ce1d8bcb2b5fd7ca4051d0b (patch) | |
tree | 699fdadf20dae4b71b1e0650513fa718b2604d20 /Zend | |
parent | 4d7150657c6fb4154beecdfa6308e6bec5810c37 (diff) | |
download | php-git-80782eff1f1612301ce1d8bcb2b5fd7ca4051d0b.tar.gz |
Fix comparisons of "inf"=="inf" and "-inf"=="-inf"
@- Comparing the string "inf" with "inf" returned false - fixed (Zeev)
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend_operators.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index a023a69ee6..e87c4dc6e0 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -23,6 +23,7 @@ #include <stdlib.h> #include <limits.h> #include <ctype.h> +#include <math.h> #include "zend.h" #include "zend_operators.h" @@ -1361,6 +1362,11 @@ ZEND_API inline int is_numeric_string(char *str, int length, long *lval, double errno=0; local_dval = strtod(str, &end_ptr); if (errno!=ERANGE && end_ptr == str+length) { /* floating point string */ + if (local_dval==HUGE_VAL || local_dval==-HUGE_VAL) { + /* "inf" */ + return 0; + } + if (dval) { *dval = local_dval; } |