Lines Matching defs:distance
1157 * <p>Note that left rotation with a negative distance is equivalent to
1158 * right rotation: {@code rotateLeft(val, -distance) == rotateRight(val,
1159 * distance)}. Note also that rotation by any multiple of 32 is a
1160 * no-op, so all but the last five bits of the rotation distance can be
1161 * ignored, even if the distance is negative: {@code rotateLeft(val,
1162 * distance) == rotateLeft(val, distance & 0x1F)}.
1169 public static int rotateLeft(int i, int distance) {
1170 return (i << distance) | (i >>> -distance);
1179 * <p>Note that right rotation with a negative distance is equivalent to
1180 * left rotation: {@code rotateRight(val, -distance) == rotateLeft(val,
1181 * distance)}. Note also that rotation by any multiple of 32 is a
1182 * no-op, so all but the last five bits of the rotation distance can be
1183 * ignored, even if the distance is negative: {@code rotateRight(val,
1184 * distance) == rotateRight(val, distance & 0x1F)}.
1191 public static int rotateRight(int i, int distance) {
1192 return (i >>> distance) | (i << -distance);