← Back to context

Comment by eutectic

4 years ago

This is why it's a good idea to have a real integer type.

Isn't it impossible? Integers go arbitrarily large but computers don't.

  • It is possible within the limits of available memory on the computer. Rather than the usual limit of a fixed number of bits.

    I've ironically found that big integer libraries sometimes optimize math routines more than string conversion. This was quite annoying for me when I optimized the factorial function in Ruby, and found that generating the string was my bottleneck. I then optimized that as well. :-)

  • They can go large enough for anything that matters.

    A quick Google says there's an estimate of 10^78 to 10^82 atoms in the universe. That number would be able to be stored in well under 300 bits.