summaryrefslogtreecommitdiff
path: root/ext/standard/math.c
diff options
context:
space:
mode:
authorjim winstead <jimw@php.net>2002-01-05 03:56:38 +0000
committerjim winstead <jimw@php.net>2002-01-05 03:56:38 +0000
commitb9d68b8e9db10ca8776da304c33c81c26e71a511 (patch)
treec36227e4febca24982e0a842a578fdfbcb77042f /ext/standard/math.c
parent461e1050698f3a6043f4b3330ca59b7cb122605f (diff)
downloadphp-git-b9d68b8e9db10ca8776da304c33c81c26e71a511.tar.gz
Apparently multi_convert_to_double_ex() didn't quite do what I
thought. Still need to handle numeric strings.
Diffstat (limited to 'ext/standard/math.c')
-rw-r--r--ext/standard/math.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 8e37a81dbd..147160f662 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -432,10 +432,11 @@ PHP_FUNCTION(pow)
double dval;
zend_bool wantlong;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &zbase, &zexp) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z/", &zbase, &zexp) == FAILURE) {
return;
}
+ /* TODO: handle numeric strings. */
if ((Z_TYPE_P(zbase) != IS_LONG && Z_TYPE_P(zbase) != IS_DOUBLE) ||
(Z_TYPE_P(zexp ) != IS_LONG && Z_TYPE_P(zexp ) != IS_DOUBLE)) {
php_error(E_WARNING, "Invalid argument(s) passed to %s()", get_active_function_name(TSRMLS_C));
@@ -446,8 +447,8 @@ PHP_FUNCTION(pow)
wantlong = Z_TYPE_P(zbase) == IS_LONG
&& Z_TYPE_P(zexp ) == IS_LONG && Z_LVAL_P(zexp) >= 0;
- /* need to SEPERATE_ZVAL? */
- multi_convert_to_double_ex(2,&zbase,&zexp);
+ convert_to_double(zbase);
+ convert_to_double(zexp);
/* go ahead and calculate things. */
dval = pow(Z_DVAL_P(zbase),Z_DVAL_P(zexp));