Arithmetic Operators are used for performing arithmetic operations, like addition, subtraction, multiplication, division and modulo using the specified operator between operands, which can be Numerical, Integers, Complex Numbers or Vectors. Here the operation on vectors is performed on one to one element basis.
1. Addition Operators (+)
The addition of two operands is performed.
2. Subtraction Operator (-)
The subtraction of the second operand is done from the first.
3. Multiplication Operator (*)
The multiplication of two operands is performed. The elements at corresponding positions of matrices are multiplied.
4. Division Operator (/)
The first operand is divided by the second operand.
5. Power Operator (^)
The first operand is raised to the power of the second operand.
6. Modulo Operator (%%)
It gives the remainder when the first operand is divided by the second operand.
7. Integer Division (%/%)
It gives a quotient when the first operand is divided by the second one.
> a<-4 > b<-2 > c<-a+b > d<-a-b > e<-a*b > f<-a/b > g<-a^b > h<-a%%b > i<-a%/%b >print(c) >print(d) >print(e) >print(f) >print(g) >print(h) >print(i)
 6  2  8  2  16  0  2