Arithmetic
Math Operators in Java
Symbols | Operator | Description |
---|---|---|
+ | Addition | Adds together two values |
- | Subtraction | Subtracts one value from another |
* | Multiplication | Multiplies two values |
/ | Division | Divides one value by another |
% | Modulus | Returns the division remainder |
++ | Increment | Increases the value of a variable by 1 |
-- | Decrement | Decreases the value of a variable by 1 |
Math.pow(a,b) | Exponentiation | Calculates the result of |
Code Examples
Last updated