79134155

Date: 2024-10-28 15:57:59
Score: 1
Natty:
Report link

You could do it like this:

  unsigned int log2 = 0;
  while (x != 1) {
    x >>= 1;
    log2++;
  }
  unsigned int x_log2 = log2;

The log2 value will be rounded down.

Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: damian101