what is the Algorithm used to identify the scenario

Santosh

I have scenario where for any given number i need to identify the corresponding 2 to the power of value. for example if the given number is 12:

12 is represented in 2 to the power as: 2 to the power of 3 and 2 to the power of 2 5 is represented in 2 to the power as: 2 to the power of 2 and 2 to the power of 0

Can i know the algorithm named on this scenario

Alma Do

It's name is radix conversion. Convert your number to binary radix and you'll get your sum of power of 2. For example,

12 = 1100

That means:

     1           1          0         0
     ^           ^          ^         ^
     |           |          |         |
12 = 1 * (2^3) + 1* (2^2) + 0*(2^1) + 0*(2^0)
            |          |         |         |
            V          V         V         V
            3          2         1         0

-it's by definition of what radix (numeral base) is.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Genetic algorithm encoding technique to be used in this scenario

From Dev

which sorting algorithm should be used for below scenario?

From Dev

What is MarkSelection in Eclipse, it will be used in what scenario?

From Dev

What kind of network protocol should be used in this scenario?

From Java

Cannot identify proper format for a json request body stored and used in csv file for use in a karate scenario

From Dev

Machine learning: Which algorithm is used to identify relevant features in a training set?

From Dev

What is the clustering algorithm used by hclust in R?

From Dev

What thresholding (binarization) algorithm is used in Tesseract OCR?

From Dev

Is there a way knowing what hash-algorithm is used?

From Dev

What hash algorithm is being used by @Password formula?

From Dev

.Net Machinekey.Protect - what algorithm is used?

From Dev

What algorithm can be used to diff image files?

From Dev

what is the encryption algorithm used by zip files?

From Dev

What algorithm is used to implement HermiteH function (mathematica)

From Dev

What is the compression algorithm used in FBX file?

From Dev

What algorithm is used during Git rebase?

From Dev

What color blending algorithm is used to darken a color?

From Dev

what is the encryption algorithm used by zip files?

From Dev

What algorithm is used to implement HermiteH function (mathematica)

From Dev

What determines the clearsign hash algorithm used by GnuPG?

From Dev

What search algorithm is used in the game "Circle the Dot"?

From Dev

What checksum algorithm is used by Version 5 Unix?

From Dev

what is algorithm used for change perspective of the image?

From Dev

What algorithm that was used on the sentiment analysis code in Python?

From Dev

what is the algorithm used to train NN in matlab by default?

From Dev

What is the default encryption algorithm used by Azure TDE?

From Dev

Use IF to identify what inner join should i used

From Dev

How to identify the most suitable Design Pattern for a scenario

From Dev

What is the $scenario variable in Codeception?

Related Related

  1. 1

    Genetic algorithm encoding technique to be used in this scenario

  2. 2

    which sorting algorithm should be used for below scenario?

  3. 3

    What is MarkSelection in Eclipse, it will be used in what scenario?

  4. 4

    What kind of network protocol should be used in this scenario?

  5. 5

    Cannot identify proper format for a json request body stored and used in csv file for use in a karate scenario

  6. 6

    Machine learning: Which algorithm is used to identify relevant features in a training set?

  7. 7

    What is the clustering algorithm used by hclust in R?

  8. 8

    What thresholding (binarization) algorithm is used in Tesseract OCR?

  9. 9

    Is there a way knowing what hash-algorithm is used?

  10. 10

    What hash algorithm is being used by @Password formula?

  11. 11

    .Net Machinekey.Protect - what algorithm is used?

  12. 12

    What algorithm can be used to diff image files?

  13. 13

    what is the encryption algorithm used by zip files?

  14. 14

    What algorithm is used to implement HermiteH function (mathematica)

  15. 15

    What is the compression algorithm used in FBX file?

  16. 16

    What algorithm is used during Git rebase?

  17. 17

    What color blending algorithm is used to darken a color?

  18. 18

    what is the encryption algorithm used by zip files?

  19. 19

    What algorithm is used to implement HermiteH function (mathematica)

  20. 20

    What determines the clearsign hash algorithm used by GnuPG?

  21. 21

    What search algorithm is used in the game "Circle the Dot"?

  22. 22

    What checksum algorithm is used by Version 5 Unix?

  23. 23

    what is algorithm used for change perspective of the image?

  24. 24

    What algorithm that was used on the sentiment analysis code in Python?

  25. 25

    what is the algorithm used to train NN in matlab by default?

  26. 26

    What is the default encryption algorithm used by Azure TDE?

  27. 27

    Use IF to identify what inner join should i used

  28. 28

    How to identify the most suitable Design Pattern for a scenario

  29. 29

    What is the $scenario variable in Codeception?

HotTag

Archive