09-go-type-system/questions/01-questions-predeclared-types.md
3: 2^8 is 256, so you can represent 256 different states.
fmt.Printf("%08b = %d", 2, 2)
EXPLANATION = From right to left, each bit goes from 2^0 to 2^(n - 1).
1: EXPLANATION. Here: 1 is the first digit from the right. So, it is 2^(1 - 1) = 2^0 = 1.
2: EXPLANATION. Here: 1 is the second digit from the right. So, it is 2^(2 - 1) = 2^1 = 2.
3: EXPLANATION. Here: 1 is the third digit from the right. So, it is 2^(3 - 1) = 2^2 = 4.
4: EXPLANATION. Here: 1 is the fourth digit from the right. So, it is 2^(4 - 1) = 2^3 = 8.
2: 1 byte is 8 bits and int64 is 64 bits. So, 64/8=8 bytes.
2: 1 byte is 8 bits and uint32 is 32 bits. So, 32/8=4 bytes.
1: That's right. Go can change its size at the compile-time depending on which target machine you're compiling your program into.
1: That's right. A byte can represent 0-255 different values. So, it's a great fit for representing English letters, and numbers.
2: In practice, you can do it with a rune value. However, rune is 32-bits long and it can store almost every letter in existince. I'm asking for the optimal data type. Try again.
3: That would be too large for only 255 different numbers.
4: Float is not the best data type for numbers without fractional parts.
var letter uint8 = 255
fmt.Print(letter + 5)
2: Unsigned integers wrap around after their maximum capacity. Uint8's max is 255, so, if 255 + 1 is 0, then 255 + 5 is 4.
3: You're very close.
4: Uint8's max capacity is 255. It can't be 260.
var num int8 = -128
fmt.Print(num - 3)
1: int8's min capacity is -128. It can't be -131.
2: Signed integers wrap around after their minimum capacity. int8's min is -128, so, if -128 - 1 is 127, then -128 - 3 is 125.