Operators

Learn about the many different operators available in Solidity.

In Solidity, much like in other programming languages, there is always a need to perform operations on operands and variables. These operations can range from simple math to comparisons and assignments. Knowing that Solidity deals mainly with money, numbers, and complex data, there’s an even greater need to learn about the various operators we can use and choose the right one for the operation.

Categories of operators

Solidity has several operators in the following categories:

  • Arithmetic

  • Comparison/relational

  • Logical

  • Assignment

  • Conditional

Arithmetic operators

These are used to perform simple arithmetic operations like addition, subtraction, multiplication, and division. When combined, they can accomplish complex calculations and operations.

Get hands-on with 1400+ tech skills courses.