In C ++ 03, long [int] and unsigned long [int] have the largest integral range, and long double has the greatest accuracy and FP range.
In C ++ 0x, intmax_t and uintmax_t have the largest integral range and may even be greater than long long . For example, it would be reasonable if the implementation made both long and long long 64-bit and made intmax_t 128-bit.
intmax_t just used with C99, so if your implementation supports C99, you do not need to require C ++ 0x. Just include stdint.h instead of cstdint . Using "C-style" headers is absolutely safe, although I'm not sure if there is a good way to test CUP typedefs in C ++.
The exact or conveniently named floating point types were not introduced with C99 or C ++ 0x, so avoid anything like float64_t or floatmax_t if you want to carry floatmax_t .
Potatoswatter
source share