mirror of
https://github.com/php/php-src.git
synced 2026-04-28 10:43:30 +02:00
Another fix for issue indentified in bug #52550
This commit is contained in:
+5
-1
@@ -690,7 +690,11 @@ PHP_FUNCTION(log)
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "base must be greater than 0");
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_DOUBLE(log(num) / log(base));
|
||||
if (base == 1) {
|
||||
RETURN_DOUBLE(NAN);
|
||||
} else {
|
||||
RETURN_DOUBLE(log(num) / log(base));
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user