Author Topic: Help Compiling Integers greater than 2bytes (32,768) (Ackermann Function)  (Read 3984 times)

TJGeb180

  • Guest
Hey,

Looking for some advice on how to approach this I no Code::Blocks has long long ints which is up to 8bytes or 9..... something... I actually need to make this thing bigger haha. I'm working on Ackermann's functions trying to basically compute as many numbers as I can.

Here's my code (yes I no my exponents are not coded right)

int acker(int m,int n)
{
    if (m == 0)
        return (n + 1);
    if (m == 1)
        return (2 + (n + 3) - 3);
    if (m == 2)
        return (2 * (n + 3) - 3);
    if (m == 3)
        return ((pow(2,(n + 3))) - 3);
    if (m == 4)
        return ((2^(2^(n + 3))) - 3);
    if (m == 5)
        return ((2^(2^(2^(n + 3)))) - 3)
    if (m == 6)
        return ((2^(2^(2^(2^(n + 3)))))) - 3)
}


//Numbers to be put into function
int main()
{
   
             
   
    for(int i = 0; i < 1; i++){
            printf("%d ", acker(3,5));  // Inpute Ackerman numbers into acker()... Currently processing 2 bytes
                                               // Can not handle more then the Ackermann # (3,12) or (4,0)
                                                // Output must = less then 32768
    }
    return 0;

If you can get this to work to compute 2^65536 power which has 19,727 digits I'd really appreciate it and if u can get it to go even further lol and get it to compute 2^18,446,744,073,709,551,616 then I envy you haha.

Acker(3,12) = 32768
Acker(4,1) = 65533

the 2 numbers I'm trying to compute are

Acker(5,1) and Acker(5,3)

Thanks for the help guys

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Help Compiling Integers greater than 2bytes (32,768) (Ackermann Function)
« Reply #2 on: November 04, 2010, 06:20:17 pm »
Unrelated to C::B (it's "just" an IDE not a compiler) and therefore violating our forum rules.

Note: this website is dedictaed to C::B and not to general programming questions only.

Topic locked !