You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
##Description
The shr (shift right) operator produces the value of A shifted B bits to the right. Both A and B must be non-negative integers (natural numbers).
##Example
Assign the base 2 value 1101 to i and then shift it right by 2 places and assign the resulting base 2 value 11 to j.
var i, j : int
i := 2 # 1101 % 2#1101 = 13 (base 10)
j := i shr 2 % j becomes 2#11 = 3 (base 10)
##Details
The shr operator is defined mathematically (in a machine- independent way) as follows: AshrB = Adiv 2**B.
Value A can be of any integer type (as long as it is non-negative) or any natural number type.
The shr operator has the same precedence as the * operator.