Arithmetic Operators
a + b |
a is added to b |
a - b |
b is subtracted from a |
a / b |
a is divided by b |
a % b |
Gets remainder of a by dividing with b |
| a * b
| a
is multiplied with b
|
let (a, b) = (4, 5);
let sum: i32 = a + b; // => 9
let subtractions: i32 = a - b; // => -1
let multiplication: i32 = a * b; // => 20
let division: i32 = a / b; // => 0
let modulus: i32 = a % b; // => 4
Comments