Posted By
|
Message
|
Spitznagl Cabinetmaker
Registered 06/12/2008
Points 4260
|
28th March, 2009 at 04:54:39 -
I really need to store 12 digit values to my array. 9 is the maximum I could store & get out accurate for a numeric array.
So I've modified everything to store strings values instead (since you can store way more caracters), but it seems like I've lost my time.
If I write a string this way "111222333444", I get it out complete.
But if I write it with a calcul: Str$(calcul), it still gets out rounded like 1.11222e+011
Is there any way I can come across that? Could the data limit simply be increased some way, like you'd do with an longinteger in real programing?
...
|
Cecilectomy noPE
Registered 19/03/2005
Points 305
|
28th March, 2009 at 10:33:22 -
standard 32bit signed int can only store values from −2,147,483,648 to +2,147,483,647 unsigned from 0 to +4,294,967,295
its actually 10 digits.
you shouldnt need to ever really use more than that. and on rare occasions you would use a __int64/ int_64 / long long (64bit int).
the only time ive ever needed to use numbers that large was when i was programming a simple app to calculate perfect numbers. the 8th iteration the number is 2305843008139952128 making it almost impossible for a standard c++ app to calculate.
apparently you can get up to 39 digits using an octaword integer but it is only available nonstandard.
mmf isnt something you should be using to handle such large numbers.
Edited by Cecilectomy
n/a
|
Spitznagl Cabinetmaker
Registered 06/12/2008
Points 4260
|
28th March, 2009 at 11:41:45 -
Thanks for the infos!
As you say, I might be pushing the limit a bit.
I'll sure keep that in mind for my next project.
For now, I've found that it works if I split my value in two and send both parts to separates global strings first. Then, If I just add both together with no other operators, it doesn't kill it. I just tried this with no faith at all, and still it worked.
Who would have thought that 111111+222222=111111222222
...
|
|
|