Third example continued. . .
Strategy: Start s at 1 and continue to multiply it by 2 until the next multiplication by 2 would make it too big.
General picture (invariant) s is a power of 2 and s <= n
Continue as long as: 2*s <= n
Make progress toward termination and keep general picture true: s= 2*s;
// Known: nɬ. Set s to the largest power of 2 that is at most n
//invariant: s is a power of 2 and s <= n