shiftright
The shiftright function is used to perform a signed right shift, shifting the binary representation of a right by b bits.
Syntax
shiftright(BIGINT a, BIGINT b)
Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| a | Yes | DOUBLE, BIGINT, DECIMAL, or STRING | The format of parameter a includes floating-point format, integer format, and string format. If parameter a is not of type BIGINT, it is implicitly converted to BIGINT type before evaluation. |
| b | Yes | DOUBLE, BIGINT, DECIMAL, or STRING | The format of parameter b includes floating-point format, integer format, and string format. If parameter b is not of type BIGINT, it is implicitly converted to BIGINT type before evaluation. |
Return Values
Returns a value of type INT.
If a or b is NULL, NULL is returned.
Example Code
Returns 2.
select shiftright(16,3);
Returns 4.
select shiftright(36,3);
Returns 4.
select shiftright(36.123456,3.123456);
Returns NULL.
select shiftright(null,3);
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot