Next power of two in Processing

20.04.2015 by Michael

If you’ll ever need the next power of two of a number in #Processing:

int next = (int)pow(2, ceil(log(n) / log(2)));

http://stackoverflow.com/a/17379122