summaryrefslogtreecommitdiff
path: root/ext/standard/math.c
diff options
context:
space:
mode:
authorHartmut Holzgraefe <hholzgra@php.net>2000-07-30 21:55:27 +0000
committerHartmut Holzgraefe <hholzgra@php.net>2000-07-30 21:55:27 +0000
commit0df7721842deba512614b330b487671c86b485b7 (patch)
tree9a172e958354508e1f8bf3c128d950e3cb1fc3f7 /ext/standard/math.c
parentdef1424b12e839195168ec7aef911490511c22a2 (diff)
downloadphp-git-0df7721842deba512614b330b487671c86b485b7.tar.gz
fix for bug #5672
Diffstat (limited to 'ext/standard/math.c')
-rw-r--r--ext/standard/math.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ext/standard/math.c b/ext/standard/math.c
index f92ecef054..2c40a342e3 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -56,9 +56,8 @@ PHP_FUNCTION(abs)
}
/* }}} */
-/* {{{ proto int ceil(double number)
+/* {{{ proto double ceil(double number)
Returns the next highest integer value of the number */
-
PHP_FUNCTION(ceil)
{
zval **value;
@@ -70,7 +69,7 @@ PHP_FUNCTION(ceil)
convert_scalar_to_number_ex(value);
if ((*value)->type == IS_DOUBLE) {
- RETURN_LONG((long)ceil((*value)->value.dval));
+ RETURN_DOUBLE(ceil((*value)->value.dval));
} else if ((*value)->type == IS_LONG) {
RETURN_LONG((*value)->value.lval);
}
@@ -79,7 +78,7 @@ PHP_FUNCTION(ceil)
}
/* }}} */
-/* {{{ proto int floor(double number)
+/* {{{ proto double floor(double number)
Returns the next lowest integer value from the number */
PHP_FUNCTION(floor) {
@@ -92,7 +91,7 @@ PHP_FUNCTION(floor) {
convert_scalar_to_number_ex(value);
if ((*value)->type == IS_DOUBLE) {
- RETURN_LONG((long)floor((*value)->value.dval));
+ RETURN_DOUBLE(floor((*value)->value.dval));
} else if ((*value)->type == IS_LONG) {
RETURN_LONG((*value)->value.lval);
}