Sunday, May 6, 2012

How to determine whether a number is degree of given number?

For example, 128 is 27, 65536 is 216 etc.
Question: how to determine whether a number 794889263257962974796277498092801308291525640763748664903194643469338087775424965801409745320266996710649718116931109481559848982586784968419475084821084743272680947722675151641735826243378403750534655587182832000457137589153821622272 is degree of 2 or not?
Answer: f**k off it is easy :)

Well, how?

OK, let's consider the case with 2. We have the number system with base of 2, where:
decimal 0 == binary 0
decimal 1 == binary 1
decimal 2 == binary 10
decimal 4 == binary 100
decimal 8 == binary 1000
decimal 16 == binary 10000
etc.

Don't you see now, how to? ;)

Question: how to determine whether a number 340282366920938463463374607431768211456 is degree of 16 or not?
Answer: ? (But now you know, how to get it!)

No comments:

Post a Comment