Python | Java |
Arithmetic operators include +, –, *, /, %, //, and ** (exponentiation).
Two integer operands yield an integer result, unless you use /, which yields a float result. At least one float operand yields a float result. // yields an integer quotient. max, min, abs, and round are standard functions with the standard effects (round returns a float). The math module includes standard functions for trigonometry, logarithms, square roots, and so forth. Examples: round(3.14) math.sqrt(2) |
Arithmetic operators include +, –, *, /, and %.Two integer operands yield an integer result. At least one float operand yields a float result.
The Math class includes class methods such as round, max, min, abs, and pow (exponentiation), as well as methods for trigonometry, logarithms, square roots, and so forth. Examples: Math.round(3.14) Math.sqrt(2) |