Arithmetical operators

Let' s revise the main arithmetical operators for simple calculations.

Operator +

var result = 3 + 5; // the result is 8

Operator -

var result = 3 - 5; // the result is -2

Operator *

var result = 3 * 5; // the result is 15

Operator /

var result = 7 / 3; // the result is 2 (integer division)
var result2 = 5 / 2.0; // the result is 2.5 (floating-point division)

results matching ""

    No results matching ""