3 Operators

3.1 Mathematical operations

3.1.1 Sum (+)

159+789
## [1] 948

3.1.2 Subtraction (-)

789-159
## [1] 630

3.1.3 Division (/)

753/2
## [1] 376.5

3.1.4 Multiplication (*)

456*3
## [1] 1368

3.1.5 Exponential \((a^{x})\)

2^10
## [1] 1024

3.1.6 Log

log(10)
## [1] 2.302585

3.1.7 Exponential function

exp(2.302585)
## [1] 9.999999

3.1.8 Square root (sqrt)

sqrt(9)
## [1] 3

3.2 Logical operators

3.2.1 Less than (<)

1 < 2
## [1] TRUE

3.2.2 Less than or equal to (<=)

1 <= 1
## [1] TRUE

3.2.3 Greater than (>)

1 > 2
## [1] FALSE

3.2.4 Greater than or equal to (>=)

2 >= 2
## [1] TRUE

3.2.5 Exactly equal to (==)

2 == 3
## [1] FALSE

3.2.6 Not equal to (!=)

3 != 3
## [1] FALSE

3.2.7 x OR y (x | y)

4 > 3 |  4 > 2
## [1] TRUE

3.2.8 x AND y (x & y)

4 > 3 & 4 > 5
## [1] FALSE