Board index » cppbuilder » How do I hold Large nums like: 7365209600
LarryJ
CBuilder Developer |
LarryJ
CBuilder Developer |
How do I hold Large nums like: 73652096002008-08-03 01:01:44 PM cppbuilder84 I need to create an array that can hold the volume number from the Dow Jones Industrial Average daily stock trading. A few sample numbers are below. These are two large for an int. What is the best way to hold these numbers? 7365209600 6705830000 5631330000 5346050000 Thanks Larry Johnson |
Bruce Larrabee
CBuilder Developer |
2008-08-03 03:47:50 PM
Re:How do I hold Large nums like: 7365209600
Hi LarryJ,
__int32 i32 __int32 i = 123456789i32; 32 bits __int64 i64 __int64 big = 12345654321i64; 64 bits unsigned __int64 ui64 unsigned __int64 hugeInt = 1234567887654321ui64; 64 bits HTH, Bruce |
maeder
CBuilder Developer |
2008-08-03 04:14:38 PM
Re:How do I hold Large nums like: 7365209600
"LarryJ" < XXXX@XXXXX.COM >writes:
QuoteI need to create an array that can hold the volume number from the QuoteWhat is the best way to hold these numbers? {smallsort} |
Tom420
CBuilder Developer |
2008-08-04 03:27:18 AM
Re:How do I hold Large nums like: 7365209600
LarryJ wrote:
Quote7365209600 processing millions of them every second. You could use __int64 type (possibly modified by 'unsigned') Alternatively, you could user a 'double', which can hold up to 15 significant digits. Of course, using a floating point data type for non floating point data causes overhead, but it's a possibility. The choice would be based on how you receive and store the numbers, as some functions are not designed to deal with such data types. Also, it depends of what exactly you have to do with the numbers (mathematical manipulation). Hope it helps, Tom :) |
Ed Mulroy [TeamB]
CBuilder Developer |
2008-08-04 05:57:01 AM
Re:How do I hold Large nums like: 7365209600
As I understand it the volume numbers are derived from the number of lots of
100 stocks so are always multiples of 100 shares. The sole exception is Berkshire Hathaway class A (BRK.A) for whom a lot is 10 shares but the volume of that stock is insignificant compared to that of almost any other and it is not a component of the Dow Jones Industrial Average. Divide the numbers by 100 to get the number of lots and use int64 and you should be fine. . Ed QuoteLarryJ wrote in message |