Bit shift right(按位右移(Bit shift right))¶
Supported in: Batch, Streaming
Shift the given value a number of bits right.
Expression categories: Binary
Declared arguments¶
- Expression: The value to shift right.
Expression\ - Number of bits: The number of bits to shift right 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: 0
Example 2: Base case¶
Argument values:
- Expression: 12345678910
- Number of bits: 5
Output: 385802465
Example 3: Null case¶
Argument values:
- Expression:
number - Number of bits: 1
| number | Output |
|---|---|
| null | null |
Example 4: Edge case¶
Argument values:
- Expression: 2147483647
- Number of bits: 100
Output: 134217727
Example 5: Edge case¶
Argument values:
- Expression: -2147483648
- Number of bits: 10
Output: -2097152
Example 6: Edge case¶
Argument values:
- Expression: 1
- Number of bits: -10
Output: 0
中文翻译¶
按位右移(Bit shift right)¶
支持:批处理(Batch)、流处理(Streaming)
将给定值向右移动指定的位数。
表达式类别: 二元(Binary)
声明的参数¶
- 表达式(Expression): 要向右移位的值。
Expression\ - 位数(Number of bits): 向右移动的位数。
Literal\
类型变量约束: E 接受 Byte | Integer | Long | Short
输出类型: E
示例¶
示例 1:基础情况¶
参数值:
- 表达式: 1
- 位数: 1
输出: 0
示例 2:基础情况¶
参数值:
- 表达式: 12345678910
- 位数: 5
输出: 385802465
示例 3:空值情况¶
参数值:
- 表达式:
number - 位数: 1
| number | 输出 |
|---|---|
| null | null |
示例 4:边界情况¶
参数值:
- 表达式: 2147483647
- 位数: 100
输出: 134217727
示例 5:边界情况¶
参数值:
- 表达式: -2147483648
- 位数: 10
输出: -2097152
示例 6:边界情况¶
参数值:
- 表达式: 1
- 位数: -10
输出: 0