Implementing Logical Right Shift in C

int lsr(int x, int n)
{
  return (int)((unsigned int)x >> n);
}

Leave a Comment