Signed long long int

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
(released)
(Other C++ data types storing signed integers)
 
(One intermediate revision by one user not shown)
Line 17: Line 17:
 
| conforms to    =  
 
| conforms to    =  
 
| released      = 2011
 
| released      = 2011
| image          =  
+
| image          = Whole numbers.png
 
| caption        =  
 
| caption        =  
 
}}
 
}}
Line 38: Line 38:
 
* [[signed short int|short]] at least 16 bits, not smaller than signed char
 
* [[signed short int|short]] at least 16 bits, not smaller than signed char
 
* [[signed int|int]] not less than 16 bits, not smaller than short
 
* [[signed int|int]] not less than 16 bits, not smaller than short
* [[signed long|long]] not less than 32 bits, not smaller than int
+
* [[signed long int|long]] not less than 32 bits, not smaller than int
  
 
[[Category:Integer data types]]
 
[[Category:Integer data types]]
 
[[Category:Enumerable data types]]
 
[[Category:Enumerable data types]]
 
[[Category:C++11 data types]]
 
[[Category:C++11 data types]]

Latest revision as of 18:28, 9 June 2015

File Format
Name signed long long int
Ontology
Released 2011

Whole numbers.png


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.

[edit] Other C++ data types of the same size

[edit] 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
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox