Formula for computing the number of shifts when the number of shifts given is negative:
for integer: (32*(x%32) + (32+x))
for long: (64*(x%64) + (64+x))
where x is a negative number that is in the range of int or long.(whichever is applicable)
Formula for computing the number of shifts when the number of shifts given is greater than the number of bits for the primitive type:
for integer: (x%32)
for long: (x%64)
where x is a positive number that is greater than the number of bits of int or long.(whichever is applicable)