Is there a language standard C++ type that's 64 bits in size?
Visual C++ supports __intn where n can be 8, 16, 32, or 64, but what about other compilers? Are these types supported on Mac, or Linux compilers as well?
Apparently the long long int type is part of the C standard, but is it part of C++ yet?
I'm having trouble finding non-Microsoft specific information on this topic, and I'm also having trouble finding information newer than 2005.
Standard Types
Started by roboticforest, Jan 12 2009 05:49 PM
3 replies to this topic
#1
Posted 12 January 2009 - 05:49 PM
Dave
|
|
|
#2
Posted 12 January 2009 - 07:25 PM
Well C++ defines that:
short has to be at least 16bits,
int has to be at least 16bits
long has to be at least 32bits
C++ has not adopted the long long type like C99 so I do not think that C++ has a portable 64bit int type yet.But the standard does not declare max int sizes so almost all 64bit systems use long as the 64bit type. Here is a link to explain a little more.http://home.att.net/...c/inttypes.html
If you need portable big numbers GMP is nice The GNU MP Bignum Library
the GMP C++ classes overload the operators so they are much easier than Java big nums. GMP is LGPL so you can use it in non free software too.
short has to be at least 16bits,
int has to be at least 16bits
long has to be at least 32bits
C++ has not adopted the long long type like C99 so I do not think that C++ has a portable 64bit int type yet.But the standard does not declare max int sizes so almost all 64bit systems use long as the 64bit type. Here is a link to explain a little more.http://home.att.net/...c/inttypes.html
If you need portable big numbers GMP is nice The GNU MP Bignum Library
the GMP C++ classes overload the operators so they are much easier than Java big nums. GMP is LGPL so you can use it in non free software too.
I'm the master of code rot
#3
Posted 13 January 2009 - 08:31 AM
#4
Posted 13 January 2009 - 08:39 AM
C++ is designed with portability in mind. As a result, it has to work on a variety of systems. Having the types you are suggesting is actually contrary to the C++ approach to doing things.


Sign In
Create Account


Back to top









