my$a=256; for(my$b=1;$b<1E9;$b*=2) { if($a==$b){print'Match!';last;} }
In reply to Re: How can I tell if a number is a power of 2?
by talexb
in thread How can I tell if a number is a power of 2?
by larryk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |