sub is_power_of_two { not $_[0] & $_[0]-1 } [download]
In reply to Re: How can I tell if a number is a power of 2? by dpuu in thread How can I tell if a number is a power of 2? by larryk