Lines Matching defs:distance
1112 * <p>Note that left rotation with a negative distance is equivalent to
1113 * right rotation: {@code rotateLeft(val, -distance) == rotateRight(val,
1114 * distance)}. Note also that rotation by any multiple of 64 is a
1115 * no-op, so all but the last six bits of the rotation distance can be
1116 * ignored, even if the distance is negative: {@code rotateLeft(val,
1117 * distance) == rotateLeft(val, distance & 0x3F)}.
1124 public static long rotateLeft(long i, int distance) {
1125 return (i << distance) | (i >>> -distance);
1134 * <p>Note that right rotation with a negative distance is equivalent to
1135 * left rotation: {@code rotateRight(val, -distance) == rotateLeft(val,
1136 * distance)}. Note also that rotation by any multiple of 64 is a
1137 * no-op, so all but the last six bits of the rotation distance can be
1138 * ignored, even if the distance is negative: {@code rotateRight(val,
1139 * distance) == rotateRight(val, distance & 0x3F)}.
1146 public static long rotateRight(long i, int distance) {
1147 return (i >>> distance) | (i << -distance);