I am trying to understand this for loop pattern:
for { // Shift n right by 1 before looping to halve it. n := shr(1, n) } n { // Shift n right by 1 each iteration to halve it. n := shr(1, n) } { ... } I guess it can be translated into
for(uint256 n = n/2; n > 0; n = n/2) { ... } OR for(n >> 1; n > 0; n >> 1) { ... } Is that correct ? I'm mainly concerned with the stop (middle) parameter but maybe even other parameters are incorrect.