Not fast, of course, but perfectly fine when called only once such as for a new constant (or other inlineable subs)
use Some::Other::Module 'SOM_FLAGS_MAX'; use constant MY_FLAGS_MIN => (1<<length(sprintf("%b", SOM_FLAGS_MAX));
In reply to Re: Power of two round up.
by jimav
in thread Power of two round up.
by boo_radley
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |