We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
You have a good point, but some people may need an example to understand what you mean by this.
Modulus division by any non-negative power of 2 can be replaced by bitwise AND operator & with (2 ** n) - 1 as the second operand, so WHERE condition MOD(ID, 2) = 0 may be turned into ID & 1 = 0.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Weather Observation Station 3
You are viewing a single comment's thread. Return to all comments →
You have a good point, but some people may need an example to understand what you mean by this.
Modulus division by any non-negative power of 2 can be replaced by bitwise AND operator
&
with (2 ** n) - 1 as the second operand, so WHERE conditionMOD(ID, 2) = 0
may be turned intoID & 1 = 0
.