1
0
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:
Ilia Alshanetsky
2010-08-06 20:04:29 +00:00
parent e4b1575d58
commit 34e8b615ed
+5 -1
View File
@@ -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));
}
}
/* }}} */