Bit shift left(按位左移(Bit shift left))¶
Supported in: Batch, Streaming
Shift the given value a number of bits left.
Expression categories: Binary
Declared arguments¶
- Expression: The value to shift left.
Expression\ - Number of bits: The number of bits to shift left by.
Literal\
Type variable bounds: E accepts Byte | Integer | Long | Short
Output type: E
Examples¶
Example 1: Base case¶
Argument values:
- Expression: 1
- Number of bits: 1
Output: 2
Example 2: Base case¶
Argument values:
- Expression: 12345678910
- Number of bits: 5
Output: 395061725120
Example 3: Null case¶
Argument values:
- Expression:
number - Number of bits: 1
| number | Output |
|---|---|
| null | null |
Example 4: Edge case¶
Argument values:
- Expression: -2147483648
- Number of bits: 100
Output: 0
Example 5: Edge case¶
Argument values:
- Expression: 2147483647
- Number of bits: 10
Output: -1024
Example 6: Edge case¶
Argument values:
- Expression: 1
- Number of bits: -10
Output: 4194304
中文翻译¶
按位左移(Bit shift left)¶
支持:批处理(Batch)、流处理(Streaming)
将指定值按位左移若干位。
表达式类别: 二元运算(Binary)
声明参数¶
- 表达式(Expression): 要左移的值。
表达式\ - 位数(Number of bits): 左移的位数。
字面量\
类型变量约束: E 接受 Byte | Integer | Long | Short
输出类型: E
示例¶
示例 1:基础情况¶
参数值:
- 表达式: 1
- 位数: 1
输出: 2
示例 2:基础情况¶
参数值:
- 表达式: 12345678910
- 位数: 5
输出: 395061725120
示例 3:空值情况¶
参数值:
- 表达式:
number - 位数: 1
| number | 输出 |
|---|---|
| null | null |
示例 4:边界情况¶
参数值:
- 表达式: -2147483648
- 位数: 100
输出: 0
示例 5:边界情况¶
参数值:
- 表达式: 2147483647
- 位数: 10
输出: -1024
示例 6:边界情况¶
参数值:
- 表达式: 1
- 位数: -10
输出: 4194304