跳到主要内容

GAMMALN

返回伽玛函数的自然对数。

语法

expression.GAMMALN(arg1);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

名称必需/可选数据类型默认值描述
arg1必需ApiRange | ApiName | number将计算伽玛函数自然对数的值,一个正数。

返回值

number

示例

此示例演示如何返回伽玛函数的自然对数。

// How to calculate the natural logarithm of the gamma function.

// Use a function to calculate the natural logarithm of the gamma function value.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
let ans = func.GAMMALN(0.5);
worksheet.GetRange("B2").SetValue(ans);