跳到主要内容

SQRT

返回数字的平方根。

语法

expression.SQRT(arg1);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

名称必需/可选数据类型默认值描述
arg1必需ApiRange | ApiName | number将返回其平方根的数字。

返回值

number

示例

计算数字的平方根。

// The SQRT function returns the positive square root of a numeric value.

// Get the square root of 100 and place it in cell A1.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.SQRT(100));