0

Hello all ,
Is there an algorithm for computing Very large numbers (Max 9^1000000) without BigNum ???
Thanks in advanced.

3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by arkoenig
0
unsigned long long power(int x,int y)
{
    if(y==0)return 1;
    unsigned long long psum = 1;
    while (y)
    {
        if (y & 1)
            psum *= x;
        y >>= 1;
        x *= x;
    }
    return psum;
}

Now the problem is storing the result for something like 9^1000000 , it won't fit in an unsigned long long type , That's my question , Must i Implement BigNum ??

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.