def unsigned_right_shift(a, b):
    """Computes a >>> b in Java, or an unsigned right shift. Assumes longs, e.g., 64-bit integers."""
    if a >= 0:
        return a >> b
    else:
        return ((a + 2 ** 64) >> b)