Arithmetic Operators
Arithmetic operators perform basic arithmetic on two values.
-
+ Adds two numerical values
-
- Subtracts two numerical values
-
* Multiplies two numerical values
-
/ Divides two numerical values
-
% Gives the modulo of two numerical values
-
| Performs a bitwise
ORon two integer values-
& Performs a bitwise
ANDon two integer values-
<< Performs a bitwise left shift on an integer value
-
>> Performs a bitwise right shift on an integer value
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access