Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: TJGeb180 on November 04, 2010, 04:57:36 pm

Title: Help Compiling Integers greater than 2bytes (32,768) (Ackermann Function)
Post by: TJGeb180 on November 04, 2010, 04:57:36 pm
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
Title: Re: Help Compiling Integers greater than 2bytes (32,768) (Ackermann Function)
Post by: stahta01 on November 04, 2010, 05:00:08 pm
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_What_is_Code::Blocks.3F
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_What_Code::Blocks_is_not.3F

Bye,

Tim S.
Title: Re: Help Compiling Integers greater than 2bytes (32,768) (Ackermann Function)
Post by: Jenna 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 !