These 3 functions implement the left, right and unsigned right shift operators, commonly found in C-style languages. They are implemented as table-valued functions and can be used like so:
-- Returns y = x << s
SELECT y FROM dbo.shiftLeft(x, s)
-- Returns y = x >> s
SELECT y FROM dbo.shiftRight(x, s)
-- Returns y = x >>> s
SELECT y FROM dbo.shiftRight0(x, s)
They will work with any input (no numeric overflows) and negative values are handled properly.