diff options
author | Andrea Faulds <ajf@ajf.me> | 2015-10-06 16:12:48 +0100 |
---|---|---|
committer | Andrea Faulds <ajf@ajf.me> | 2015-10-08 15:45:22 +0100 |
commit | fa23bebe94d7149d7bb55d3482f4802546198c24 (patch) | |
tree | e3f1023e356bfb1ed02c730fc92f64791f3f8c3a /ext/standard/math.c | |
parent | 3815e9713601a637b30bb99d631fc68df97f9288 (diff) | |
download | php-git-fa23bebe94d7149d7bb55d3482f4802546198c24.tar.gz |
Correct intdiv() argument names and description
Diffstat (limited to 'ext/standard/math.c')
-rw-r--r-- | ext/standard/math.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/standard/math.c b/ext/standard/math.c index 9ab457b41d..6059f3dd9b 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -1456,27 +1456,27 @@ PHP_FUNCTION(fmod) } /* }}} */ -/* {{{ proto int intdiv(int numerator, int divisor) - Returns the integer division of the numerator by the divisor */ +/* {{{ proto int intdiv(int dividend, int divisor) + Returns the integer quotient of the division of dividend by divisor */ PHP_FUNCTION(intdiv) { - zend_long numerator, divisor; + zend_long dividend, divisor; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &numerator, &divisor) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", ÷nd, &divisor) == FAILURE) { return; } if (divisor == 0) { zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Division by zero"); return; - } else if (divisor == -1 && numerator == ZEND_LONG_MIN) { + } else if (divisor == -1 && dividend == ZEND_LONG_MIN) { /* Prevent overflow error/crash ... really should not happen: We don't return a float here as that violates function contract */ zend_throw_exception_ex(zend_ce_arithmetic_error, 0, "Division of PHP_INT_MIN by -1 is not an integer"); return; } - RETURN_LONG(numerator / divisor); + RETURN_LONG(dividend / divisor); } /* }}} */ |