Is there any container that would hold a number that is 10,000 characters in length? would I have to create one? If so how would I go about doing something like that?
Printable View
Is there any container that would hold a number that is 10,000 characters in length? would I have to create one? If so how would I go about doing something like that?
You'll have to make one. In order to do that, you'll have to think in terms of how two bytes are combined together to form an integer (and from there extrapolate for an n-byte number). When you add to a 2-byte number you start by adding to the least significant byte - if you get a carry, you add that to the most significant byte.
It works exactly like elementary arithmetic. I imagine you can code something that works in base-10 arithmetic or something that would work with base-2 arithmetic (bytes). Coding for base-10 would be intuitive and simple while coding for base-2 arithmetic would be faster.
What kind of number is that big... I can't imagine if I never need to use one:)
Anyway, what's you're looking for is "Big Integer" type. If you're targeting .Net 4.0 then it's the System.Numerics.BigInteger structure. If you're targeting .Net 3.5 and lower, you have to create your own.
Um, I am working with a number that is 10,000 Digits in length. It must be prime. I made a prime number finder that went through the selected starting and ending points, and listed all the prime ones. Now I want to expand that and see how large I can make the number. (Can you tell I have nothing to do? ;))
Is there any way to import .Net 4.0 into VB 2008? I don't care what framework it targets because it is really just something to abide time until I have something better to do! :)