Rust TutorialLesson 10Free preview
Rust Operators
This lesson is part of Rust · All levels
Summary
This lesson reviews the arithmetic operators, comparisons, logic, and assignments available on Rust. Rust guarantees safe mathematical operation and checks for potential integer overflow in debug mode. Understanding these operators is an important basis for designing program computation.
Key points
- Arithmetic operators include addition (+), subtraction (-), multiplication (*), division (/), and modulus (%)
- The comparison operator (==,!=, >, <, >=, <=) produces a boolean value of true or false
- Logic operators include AND (&&), OR (the "before"), and NOT (!)
- Rust does not provide the operator postfix increment (++x) or decrement (--x)
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.