3 ms·
#14 (calculating 2^n), is usually implemented as: return 1 << n; in which case it would also work for n == 0. The method shown in the article has a comment
by NonEUCitizen 13y ago
#14 (calculating 2^n), is usually implemented as:
return 1 << n;
in which case it would also work for n == 0. The method shown in the article has a comment requiring n > 0.