Math Fundamentals18 sections · 814 units
Open in Course

Lessons from Power of Two

summary

Three points:

1.1. Modulo checks divisibility. If amodb=0a \bmod b = 0, then aa is divisible by bb.

2.2. Repeated division shrinks numbers predictably. Powers of two shrink cleanly when divided by 22.

3.3. Early exit saves time. If you detect failure mid-loop, return immediately instead of continuing.