Fix issue LOG function in formulaJs library [SCI-9556] (#6481)

This commit is contained in:
wandji 2023-10-18 12:31:13 +01:00 committed by GitHub
parent f83f5a8b58
commit 7050e11225
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -884,11 +884,10 @@ exports.LOG2E = function() {
exports.LOG = function(number, base) {
number = utils.parseNumber(number);
base = utils.parseNumber(base);
base = (base === undefined) ? 10 : utils.parseNumber(base);
if (utils.anyIsError(number, base)) {
return error.value;
}
base = (base === undefined) ? 10 : base;
return Math.log(number) / Math.log(base);
};