跳到主要内容

BITLSHIFT

返回按指定位数左移后的数字。

语法

expression.BITLSHIFT(arg1, arg2);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

名称必需/可选数据类型默认值描述
arg1必需ApiRange | ApiName | number要计算的二进制数的十进制表示形式。
arg2必需ApiRange | ApiName | number数字将左移的位数。

返回值

number

示例

在电子表格中将数字向左移动给定的位数。

// What happens when you move the binary representation leftward in a spreadsheet?

// Multiply a value by moving its bits toward higher positions in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.BITLSHIFT(4, 2));