Description:
The function performs a shift operation. It supports a decimal without the fractional part.
Syntax:
shift(x,s)
Note:
Shift left if s<0; shift right if s>0.
Parameter:
x |
The expression based on which you perform the shift operation |
s |
An integer |
Option:
@s |
When shifting right, shift a sign into the leftmost position and shif a zero to this position by default |
Return value:
An integer
Example:
shift(13,2) |
3 |
shift(decimal(3),-2) |
12, which is the decimal type. |