# Thread: parse truly large numbers to binary

1. ## parse truly large numbers to binary

Hi, there

I am trying to convert 0 to some large int numbers (say, pow(a,c)) to a-binary, where pow(a,c), a and c could be large, say a=3,c=100, so the pow result could easily exceed unsigned long length (2^64-1).

What I am looking for is: say a=3 c=3, so I 'd deal with 0-26 and convert them into 3-binary (sorry if i call it wrong). Let's pick 11 (in DEC) , I want to convert it to 102 (1*3^2+0*3*1+2*3^0) and store in an int array, s.t.
bit[0] = 2
bit[1] = 0
bit[2] = 1

I know for if pow(a,c) < 2^64-1 I can use && and pick each bit value, but can anyone help if pow(a,c) > 2^64-1 ? I don't even know how to deal with it since pow(a,c) can not exceed 2^64-1 at all... Actually I do not care about what the large number is, all I want is the each bit's value (0 to c-1) in that range.

Thanks in advance!

2. ## thanks !

could you please explain more? I went through the intro and it seems like some free optimized code, so all I do is install it and find the proper func and run it? Is that simple?

appreciate!
Originally Posted by Salem

3. It's a library to do maths with very large numbers.
I can't really say much more because I can't really see what you're trying to achieve.

Popular pages Recent additions