From: Hartmut Holzgraefe Date: Sun, 30 Jul 2000 21:55:27 +0000 (+0000) Subject: fix for bug #5672 X-Git-Tag: PRE_FILE_COMPILE_API_CHANGE~70 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0df7721842deba512614b330b487671c86b485b7;p=php fix for bug #5672 --- 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); }