Alright, here's my problem. I need to store a number thats as big or higher than 1661713756910382300 into a data type other than a string or array. The problem with a string/array is that when i use one of the string -> number functions (atoi, atol, strtod...) It either completly messes it up, int makes it negitive, or formats it in such a way that i can't use it. Example code of what i need to do.
I'm running MSVS any ideas guys?
if(number % 100 = 0)
insert stuff here;
I know there is an __int64 that you can use and maybe there's an __int128 that you can use - that would take care of your number.
__int64 and beyond are MS specific.
If a number is too big, you'll have to split your number into two or more pieces. Imagine that you have counters that go up to one million and you need to count to 1.5 million... One counter counts the "number of millions" and is set to one... Another counter is set to 500,000.
This is where the concept "double" comes from, although it's handled by the compiler. Without using a scheme like this, an 8 bit processor could only handle numbers up to 256 and a 16 bit processor could only handle numbers up to 64k.
I'm not at my compiler, so no examples that I haven't tried-out! I'm asssume there are libraries to help with this.