forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com> Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
7.0 KiB
7.0 KiB
shiftrightunsigned
This function is used to perform an unsigned bitwise right shift. It takes the binary number a and shifts it b positions to the right.
Syntax
shiftrightunsigned(BIGINT a, BIGINT b)
Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
a |
Yes |
DOUBLE, BIGINT, DECIMAL, or STRING |
The value can be a float, integer, or string. If the value is not of the BIGINT type, the system will implicitly convert it to the BIGINT type for calculation. |
b |
Yes |
DOUBLE, BIGINT, DECIMAL, or STRING |
The value can be a float, integer, or string. If the value is not of the BIGINT type, the system will implicitly convert it to the BIGINT type for calculation. |
Example Code
The value 2 is returned.
select shiftrightunsigned(16,3);
The value 536870910 is returned.
select shiftrightunsigned(-16,3);
The value 2 is returned.
select shiftrightunsigned(16.123456,3.123456);
The value NULL is returned.
select shiftrightunsigned(null,3);
Parent topic: Mathematical Functions