Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 891 Bytes

2.1.md

File metadata and controls

23 lines (16 loc) · 891 Bytes
  1. int, long, long long and short
Type Minimum Size Minimum Number Range
int 16 bits -32767 ~ +32767
long 32 bits -2,147,483,647 ~ +2,147,483,647
long long 64 bits -9.22 * 10^18 ~ +9.22 * 10^18
short 16 bits -32767 ~ +32767
  1. unsigned and signed

A signed type represents negative or positive numbers (including zero).

An unsigned type represents only values greater than or equal to zero.

For a type of same size, if the number range of signed type is -n ~ +n, then the number range of unsigned type is 0 ~ 2*n+1.

  1. float and double
Type Minimum Size
float 6 significant digits (usually 32 bits)
double 10 significant digits (usually 32 bits)