跳到主要内容

LOG

返回数字以指定底数的对数。

语法

expression.LOG(arg1, arg2);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

名称必需/可选数据类型默认值描述
arg1必需ApiRange | ApiName | number将返回其对数的正实数。
arg2可选ApiRange | ApiName | number对数的底数。如果省略,则等于 10。

返回值

number

示例

此示例演示如何返回数字的指定底数对数。

// How to get the logarithm to the specified base.

// Use a function to return the logarithm.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.LOG(56, 5));