There is another way that you can dissolve your problem into small parts and
also start from the most inner part of the problem.

On Fri, Apr 29, 2011 at 12:04 PM, Apprentice
<[email protected]>wrote:

> Probably the fastest and easiest way yes.
>
>
> http://en.wikipedia.org/wiki/Power_of_two#Fast_algorithm_to_check_if_a_positive_number_is_a_power_of_two
>
>
> On 27 apr, 17:58, rjgtav <[email protected]> wrote:
> > Hi. While searching on the web, i found that there is another (less
> > complicated - for me) way to check if the value is Power of two:
> >
> > return (value & (value - 1)) == 0;
> >
> > What do you think?
>



-- 
*Template Magician Inc.*
Joomla Templates <http://www.templatemagician.com/category/Joomla-templates>
 | CSS Templates
<http://www.templatemagician.com/category/CSS-templates> | VirtueMart
Templates <http://www.templatemagician.com/virtuemart-templates.html>
4648 Haviland Court, Naperville, ILLINOIS 60564
Phone: 1-630-300-3935
Fax: 630-364-5887
Web: http://www.templatemagician.com/

Reply via email to