Reputation: 24213
I understand there are long and unsigned longs available, but if I were to do computations on astronomical numbers, how do computers handle those?
I guess if I were working with C, then in that case the size of int is really dependent on the platform, but even in that case the size can not be 64 bit right?
For java I guess the size is limited, how do they do it then?
Thanks
Upvotes: 1
Views: 41
Reputation: 8562
I think this is what you are looking for:
In computer science, arbitrary-precision arithmetic, also called bignum arithmetic, multiple precision arithmetic, or sometimes infinite-precision arithmetic, indicates that calculations are performed on numbers whose digits of precision are limited only by the available memory of the host system. This contrasts with the faster fixed-precision arithmetic found in most arithmetic logic unit (ALU) hardware, which typically offers between 8 and 64 bits of precision.
https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic
Upvotes: 1