summaryrefslogtreecommitdiff
path: root/ext/standard/math.c
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2001-12-21 16:38:49 +0000
committerDerick Rethans <derick@php.net>2001-12-21 16:38:49 +0000
commitca1bcd9ac3f61e234061443ed98e370a2ca6c5bf (patch)
tree8148c211ca4cfa7ce9c1905db8797e11225b88a1 /ext/standard/math.c
parentba1d89b386a756f780bd97f593fba9683ea7d4f6 (diff)
downloadphp-git-ca1bcd9ac3f61e234061443ed98e370a2ca6c5bf.tar.gz
- Fix for bug #14646, floor() always returns a float now.
Diffstat (limited to 'ext/standard/math.c')
-rw-r--r--ext/standard/math.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 484809982e..ba1df9937d 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -82,7 +82,6 @@ PHP_FUNCTION(ceil)
/* }}} */
/* {{{ proto float floor(float number)
Returns the next lowest integer value from the number */
-
PHP_FUNCTION(floor)
{
zval **value;
@@ -96,7 +95,8 @@ PHP_FUNCTION(floor)
if (Z_TYPE_PP(value) == IS_DOUBLE) {
RETURN_DOUBLE(floor(Z_DVAL_PP(value)));
} else if (Z_TYPE_PP(value) == IS_LONG) {
- RETURN_LONG(Z_LVAL_PP(value));
+ convert_to_double_ex(value);
+ RETURN_DOUBLE(Z_DVAL_PP(value));
}
RETURN_FALSE;