Question:

How do u identify if a number is a power of 2?

by  |  earlier

0 LIKES UnLike

How do u identify if a number is a power of 2?

 Tags:

   Report

5 ANSWERS


  1. A number X is a power of 2 if X = 2^n

    Then ln (X) = ln (2^n) = n ln (2)

    n = ln (X) / ln (2)

    If n = ln (X) / ln (2) is an integer, then X is an integer whole multiple of 2.

    If n is not a whole number, X is still a power of 2, but not an integer power of 2; i.e.

    6 = 2^2.5849625...

    6 = 2 to the 2.5849625... power


  2. its divisible by 2 too ..

  3. Look at the units digit of the number.

    A number which is the power of 2 will heve

    either 0,1,4,5,6 or 9 at its units place.

    But not vice versa.

  4. The simplest way is to take the logarithm for base 2 for the number which you want to know whether it is a power of 2.

    Regards,

  5. Enter 1 on your hand held calculator. Multiply by 2. Repeat. You'll get 4, 8, 16, etc. If you go past your sample number but don't equal it, it's not a power of 2.

Question Stats

Latest activity: earlier.
This question has 5 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.