Operators: Arithmetic, In, and Range
Explore and understand arithmetic operators, range operators, and the in operator for collections and ranges.
We'll cover the following...
Arithmetic operators
Let’s start with arithmetic operators, like plus
or times
. These are easiest for the Kotlin compiler because it just needs to transform the left column to the right.
Expression | Translation |
|
|
|
|
|
|
|
|
|
|
|
|
Points to remember:
The
%
operator translates torem
, which is a short form of remainder. This operator returns the remainder left over when one operand is ...