Biggest number in computer ever

前端 未结 14 991
傲寒
傲寒 2021-01-30 09:12

Just asked by my 5 year old kid: what is the biggest number in the computer?

We are not talking about max number for a specific data types, but the biggest number that a

相关标签:
14条回答
  • 2021-01-30 09:37

    The answer to life (and this kids question): 42

    0 讨论(0)
  • 2021-01-30 09:43
    //  wait to see
    for(;;)
    {
        printf("9"); 
    }
    
    0 讨论(0)
  • 2021-01-30 09:43

    Don't know much about theory, but I far as I understood from your question, is: what is the largest number that the computer can represent (and I add: in a reasonable time, and not printing "9" until the Earth will "be eaten by the Sun"). And I put my PC to make one simple calculation (in PHP or whatever language): echo pow(2,1023) - resulting: 8.9884656743116E+307. So I guess this is the largest number that my PC can calculate. On the other side, I think the respresentation of the largest negative number can be: -0,(0)1

    LE: That computed value was obataind through PHP, but I tried to figure out what's the largest number that my windows calculator can compute, and it is pow(2, 33219) = 8.2304951207588748764521361245002E+9999. Now I guess this is the largest number my PC can handle.

    0 讨论(0)
  • 2021-01-30 09:45

    Well I had the same question earlier this day, so thought why not to make a little c++ codes to see where the computer gonna stop ... But my laptop wasn't with me in class so I used another, well the number was to big but it never ends, i'll run it again for a night then i'll share the number you can try the code is stupid

    #include <stdlib.h>
    #include <stdio.h>
    
    int main() {
        int i = 0;
    
        for (i = 0; i <= i; i++) {
            printf("%i\n", i);
            i++;
        }
    }
    

    And let it run till it stops ^^

    0 讨论(0)
  • 2021-01-30 09:46

    This question is actually a very interesting one which mathematicians have devoted a fair bit of thought to. You can read about it in this article, which is a fascinating and accessible read.

    Briefly, a guy named Tibor Rado set out to find some really big, but still well-defined, numbers by defining a sequence called the Busy Beaver numbers. He defined BB(n) to be the largest number of steps any Turing Machine could take before halting, given an input of n symbols. Note that this sequence is by its very nature not computable, so the numbers themselves, while well-defined, are very difficult to pin down. Here are the first few:

    BB(1) = 1
    BB(2) = 6
    BB(3) = 21
    BB(4) = 107
    

    ... wait for it ...

    BB(5) >= 8,690,333,381,690,951
    

    No one is sure how big exactly BB(5) is, but it is finite. And no one has any idea how big BB(6) and above are. But at least these numbers are completely well-defined mathematically, unlike "the largest number any human has ever thought of, plus one." ;)

    So how about this:

    The biggest number a computer can represent is the most instructions a program small enough to fit in its available memory can perform before halting.

    Squared.

    No, wait, cubed. No, raised to the power of itself!

    Dammit!

    0 讨论(0)
  • 2021-01-30 09:46

    The size will obviously be limited by the total size of hard drives you manage to put into your PC. After all, you can store a number in a text file occupying all disk space.

    You can have 4x2Tb drives even in a simple box so around 8Tb available. if you store as binary, then the biggest number is 2 pow 64000000000000.

    0 讨论(0)
提交回复
热议问题