in reply to How can I tell if a number is a power of 2?
You'd pay a penalty in the calculation, but by the time you get done with sprintf, pattern matching, and a conditional I think the gap would be a lot closer.return ! $number % 2;
Originally posted as a Categorized Answer.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How can I tell if a number is a power of 2?
by VSarkiss (Monsignor) on Jan 28, 2002 at 23:16 UTC |