memory - How does an environment (e.g. Ruby) handle massive integers? -
Ruby (MRI) refuses to overflow my integer. I have seen a change in class from Fixanam to Bignna but I am wondering how it has been modeled and what kind of process Ruby uses to make arithmetic on such a huge integer. I have seen this behavior in SCHEME as well as in other environments.
I ask because I want to implement something similar in C program and would like to know that Bignam + Bignam reduces primitive operations
Any sign?
Python also does this.
In fact, rather than behaving as a string of bits instead of behaving as a string of bits that fits the hardware architecture (for example 32 bits), this number is a string of 32-bit digits It is believed that to handle all the arithmetic, from 32-bit digits to the second, the action involves allocating additional 32-bit digits in it because the number is increasing. For example, 99 * 99 is less than 100 * 100 which is 10,000, therefore one can assume that by multiplying the two 2 digit number, no more than 4 digits can be found. . The same thing applies when every digit is 32-bit words.
You can try applying it to Ruby, just for fun, using some sort of binary quantity that you can use. I believe that the Fixx class will work.
Comments
Post a Comment