how to determine base of a number?

Posted by evil.coder on Stack Overflow See other posts from Stack Overflow or by evil.coder
Published on 2010-04-08T13:20:08Z Indexed on 2010/04/08 13:23 UTC
Read the original article Hit count: 321

Filed under:
|
|
|

Given a integer number and its reresentation in some arbitrary number system. The purpose is to find the base of the number system. For example, number is 10 and representation is 000010, then the base should be 10. Another example: number 21 representation is 0010101 then base is 2. One more example is: number is 6 and representation os 10100 then base is sqrt(2). Does anyone have any idea how to solve such problem?

© Stack Overflow or respective owner

Related posts about c++

Related posts about algorithm