]> granicus.if.org Git - php/commitdiff
fix for bug #5672
authorHartmut Holzgraefe <hholzgra@php.net>
Sun, 30 Jul 2000 21:55:27 +0000 (21:55 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Sun, 30 Jul 2000 21:55:27 +0000 (21:55 +0000)
ext/standard/math.c

index f92ecef0544abe67e62e0d2e0dbf02be5458d05b..2c40a342e38998bb74aaaff7f708a9d91f6ceee9 100644 (file)
@@ -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);
        }