Go TutorialLesson 12Free preview
Go Operators
This lesson is part of Go · All levels
Summary
This lesson describes the operators in Go: arithmetic (+, -, *, /, %), comparison (==,!=, <, >, <= >=), logic (&&, 13:1,!), and definitions such as = and +=. Go also provides bitwise operators for bit manipulation. Notice that dividing two integers gives you an integer.
Key points
- The arithmetic operator works on the numbers and % produces the remainder of the
- The logic operator && and the mouse only accept the bool operand
- The comparison operator produces a bool value
- Dividing two ints is to throw out the fraction (integer division)
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.