Signed long long int
(Created page with "{{FormatInfo | name = signed long long int | formattype = electronic | subcat = Data types | subcat2 = C++ data types | subcat3 = | subcat...") |
(released) |
||
Line 16: | Line 16: | ||
| uniform type = | | uniform type = | ||
| conforms to = | | conforms to = | ||
− | | released = | + | | released = 2011 |
| image = | | image = | ||
| caption = | | caption = |
Revision as of 06:58, 13 May 2015
C++ signed long long int will take at least 64 bits of memory to hold and cannot be less than signed long int in any specific implementation; it can, however, differ from compiler to compiler. It usually gets stored as two's complement integer, but it is not a requirement of the standard.
It can be shortened during declaration or conversion to signed long long, long long int, or just long long. There is another type that is called just long, but there is no "long long long".
long long can safely store values -2⁶³ – 2⁶³-1, if the value gets too large or too small, a roll over can take place. While the fact of a roll over is a guarantee at some point, a coder cannot assume that it will happen in a specific place, LLONG_MIN and LLONG_MAX constants from <climits> library can be used to determine that.
This is the largest built in data type in C++ at this moment, and it was not available until C++11, unless a specific compiler provided it as a non-standard extension.
Other C++ data types of the same size
- unsigned long long int
- wchar_t (however, it really is a bad conversion, since even an OS change will render it invalid)
Other C++ data types storing signed integers
- signed char at least 8 bits
- short at least 16 bits, not smaller than signed char
- int not less than 16 bits, not smaller than short
- long not less than 32 bits, not smaller than int