How to convert an arbitrary large integer from base 10 to base 16?

后端 未结 7 2001
旧时难觅i
旧时难觅i 2021-02-04 21:39

The program requires an input of an arbitrary large unsigned integer which is expressed as one string in base 10. The outputs is another string that expresses the integer in bas

7条回答
  •  自闭症患者
    2021-02-04 22:23

    Here's a BigInt library:

    http://www.codeproject.com/KB/cs/BigInt.aspx?msg=3038072#xx3038072xx
    

    No idea if it works, but it's the first one I found with Google. It appears to have functions to parse and format big integers, so they may support different bases too.

    Edit: Ahh, you're using C, my mistake. But you may be able to pick up ideas from the code, or someone using .NET may have the same question, so I'll leave this here.

提交回复
热议问题