All pastes #393616 Raw Edit

Someone

public text v1 · immutable
·published 2007-03-13 18:37 UTC
rendered paste body
public static DevInt rightShift(DevInt input, DevInt shift) {
        DevInt tmp = new DevInt(input);
        while (shift > 0) {
            if (shift > Int32.MaxValue) {
                shift = shift - Int32.MaxValue;
                tmp = tmp >> Int32.MaxValue;
            }
            else {
                tmp = tmp >> BitConverter.ToInt32(shift.getBytes(), 0);
                shift = 0;
            }
        }
        return tmp;
    }