08-numbers-and-strings/01-numbers/questions/03-assignment-operations.md
n by 1?var n float64
n = +1n = n++n = n + 1 CORRECT++n1: This just assigns 1 to n.
2: IncDec statement can't be used as an operator.
4: Go doesn't support prefix incdec notation.
n by 1?var n int
n = -1n = n--n = n - 1 CORRECT--n1: This just assigns -1 to n.
2: IncDec statement can't be used as an operator.
4: Go doesn't support prefix incdec notation.
n = n + 1?n++ CORRECTn = n++++nn = n ++ 12: IncDec statement can't be used as an operator.
3: Go doesn't support prefix incdec notation.
4: What's that? ++?
n = n + 1?n = n++n += 1 CORRECT++nn = n ++ 11: IncDec statement can't be used as an operator.
3: Go doesn't support prefix incdec notation.
4: What's that? ++?
n -= 1?n = n--n += 1--n-- CORRECT--n1: IncDec statement can't be used as an operator.
2: IncDec statement can't be used as an operator. And also, you can't use it with
1--. The value should be addressable. You're going to learn what that means soon.4: Go doesn't support prefix incdec notation.
length by 10?length = length // 10length /= 10 CORRECTlength //= 101: What's that?
//?2: That's right. This equals to:
length = length / 103: What's that?
//=?
x = x % 2?x = x / 2x =% 2x %= 2 CORRECT1: This is a division. You need to use the remainder operator.
2: Close... But, the
%operator is on the wrong side of the assignment.
fmtconv.ToFloatconv.ParseFloatstrconv.ParseFloat CORRECTstrconv.ToFloatIf you don't remember it, this its function signature:
func ParseFloat(s string, bitSize int) (float64, error)
strconv.ParseFloat("10", 128)strconv.ParseFloat("10", 64) CORRECTstrconv.ParseFloat("10", "64")strconv.ParseFloat(10, 64)1: There are no 128-bit floating point values in Go (Actually there are, but they only belong to the compile-time).