sciguy125
1st October 2004, 04:19 AM
I'm using g++ to (obviously) compile a C++ program.
I have a variable of type unsigned long long. I know that it's 64-bits because sizeof says that it's 8 bytes. I also ran a loop with a counter to see how big it is. If I have something during run time store an obsenely large number in it (something within it's limits... <2^64), it works and is able to output it to the screen. If I try to store a large number during compile time, it doesn't like it. I get the following error:
main.cpp:30: error: integer constant is too large for "long" type
here's the relevant code:
typedef unsigned long long int64;
int64 test_time = 62000000000;
It looks like it thinks that test_time is a long.
I have a variable of type unsigned long long. I know that it's 64-bits because sizeof says that it's 8 bytes. I also ran a loop with a counter to see how big it is. If I have something during run time store an obsenely large number in it (something within it's limits... <2^64), it works and is able to output it to the screen. If I try to store a large number during compile time, it doesn't like it. I get the following error:
main.cpp:30: error: integer constant is too large for "long" type
here's the relevant code:
typedef unsigned long long int64;
int64 test_time = 62000000000;
It looks like it thinks that test_time is a long.