跳到主要内容

IMSUB

返回以 x + yix + yj 形式表示的两个复数的差。

语法

expression.IMSUB(arg1, arg2);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

名称必需/可选数据类型默认值描述
arg1必需ApiRange | ApiName | number将从中减去第二个数的复数。
arg2必需ApiRange | ApiName | number要从第一个数中减去的复数。

返回值

number

示例

在电子表格中将两个复数相减。

// How do I subtract two complex numbers in a spreadsheet?

// Find the difference between two complex values in a spreadsheet.

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