Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

numeric_limits doesn't understand 64 bit integers

807575Oct 29 2003 — edited Nov 5 2003

If you run the following code, you will find that Forte 6 Update 2 (patched) thinks that the maximum value of a 64 bit integer is zero. The same results with long long or unsigned long long.
#include <limits>
#include <iostream>
#include <inttypes.h>

using namespace std;

int main(int argc, char * argv[])
{

   std::cout << "int32_t: " << numeric_limits<int32_t>::max() << std::endl;
   std::cout << "uint32_t: " << numeric_limits<uint32_t>::max() << std::endl;
   std::cout << "int64_t: " <<numeric_limits<int64_t>::max() << std::endl;
   std::cout << "uint64_t: " <<numeric_limits<uint64_t>::max() << std::endl;
   std::cout << "long long: " <<numeric_limits<long long>::max() << std::endl;
   std::cout << "unsigned long long: " <<numeric_limits<unsigned long long>::max() << std::endl;

   return 0; 

}
Results:

int32_t: 2147483647
uint32_t: 4294967295
int64_t: 0
uint64_t: 0
long long: 0
unsigned long long: 0
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 3 2003
Added on Oct 29 2003
3 comments
413 views