跳到主要内容

IMSUM

返回指定复数的和。

语法

expression.IMSUM(args);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

名称必需/可选数据类型默认值描述
args必需ApiRange | ApiName | string最多 255 个以 x + yix + yj 形式表示的复数。

返回值

number

示例

此示例演示如何返回以 x + yi 或 x + yj 形式表示的两个复数的和。

// How to add two complex numbers.

// Use a function to get the sum of two complex number.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.IMSUM("1+3i", "0.1+1.5j", "-2+2.5i"));