Variables
Just a short question: Is it possible to define a variable with xyz bytes? I want to make a program that deals with a very large number, but normal integers just don't go that far. :(
Thanks,
~Dakar
If you're using Java, there's a class that handles just what you speak of BigInteger, I believe.
FOR C/C++:
Also, you can use a dynamically allocated array with each element being an integer if you need a huge amount of space. You can also store the integer in a regular array, also.
If you do either of the above, you'll need to create a function that stores and retrieves the information within the array.
FOR C/C++:
Also, you can use a dynamically allocated array with each element being an integer if you need a huge amount of space. You can also store the integer in a regular array, also.
If you do either of the above, you'll need to create a function that stores and retrieves the information within the array.
Rather than doing it manually, you should probably look for an existing arbitrary precision computation library. Here's a fairly good link on arbitrary precision computation. At the bottom of that page there are some links to premade multi-precision packages.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement