summaryrefslogtreecommitdiff
path: root/ext/standard/math.c
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2002-02-21 11:44:41 +0000
committerYasuo Ohgaki <yohgaki@php.net>2002-02-21 11:44:41 +0000
commit15daf9928819f213c331c8fd6fe4412be703b8bd (patch)
treed9bf95db2e6d101c36b2995d3e2d2a0258753c9c /ext/standard/math.c
parentbe1b9927e57db4184cfa0fd2a48466a41df37ea7 (diff)
downloadphp-git-15daf9928819f213c331c8fd6fe4412be703b8bd.tar.gz
Added fmod() function
# Is there any reason that math.c does not use errno?
Diffstat (limited to 'ext/standard/math.c')
-rw-r--r--ext/standard/math.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/standard/math.c b/ext/standard/math.c
index d594a5a21e..fea4be5f3b 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -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