5.3.95 _Q31shr Function
This function shifts a Q31 value by num
bits, to the right if
num
is positive or to the left if num
is negative.
The function takes care of saturating the result, in case of underflow or overflow.
Include
<libq.h>
Prototype
_Q31 _Q31shr(_Q31 x, short num);
Arguments
x |
a fixed-point number in Q31 format, which ranges from -231 to 231-1. The value of this argument ranges from -2147483648 to 2147483647. |
num |
an integer number, which ranges from -31 to 31. |
Return Value
This function returns the shifted value of x
in Q31 format. The value
ranges from -2147483648 to 2147483647.