mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Added fmod() function
# Is there any reason that math.c does not use errno?
This commit is contained in:
parent
be1b9927e5
commit
15daf99288
3 changed files with 17 additions and 0 deletions
|
@ -475,6 +475,7 @@ function_entry basic_functions[] = {
|
|||
PHP_FE(dechex, NULL)
|
||||
PHP_FE(base_convert, NULL)
|
||||
PHP_FE(number_format, NULL)
|
||||
PHP_FE(fmod, NULL)
|
||||
PHP_FE(ip2long, NULL)
|
||||
PHP_FE(long2ip, NULL)
|
||||
|
||||
|
|
|
@ -1046,6 +1046,21 @@ PHP_FUNCTION(number_format)
|
|||
}
|
||||
/* }}} */
|
||||
|
||||
/* {{{ proto double fmod(double x, double y)
|
||||
Returns the remainder of dividing x by y as a double */
|
||||
PHP_FUNCTION(fmod)
|
||||
{
|
||||
double num1, num2;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &num1, &num2) == FAILURE) {
|
||||
return;
|
||||
}
|
||||
|
||||
Z_DVAL_P(return_value) = fmod(num1, num2);
|
||||
Z_TYPE_P(return_value) = IS_DOUBLE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
|
|
@ -58,6 +58,7 @@ PHP_FUNCTION(hexdec);
|
|||
PHP_FUNCTION(octdec);
|
||||
PHP_FUNCTION(base_convert);
|
||||
PHP_FUNCTION(number_format);
|
||||
PHP_FUNCTION(fmod);
|
||||
PHP_FUNCTION(deg2rad);
|
||||
PHP_FUNCTION(rad2deg);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue