Ruby: Mathematics

There are 6 arithetic operators which we would discuss at this point

  1. Addition +
  2. Subtraction –
  3. Multiplication *
  4. Division /
  5. Exponentiation **
  6. Modulo %

All are self-explanatory but for the beginners: Exponentiation raises one number (the base) to the power of the other (the exponent).

For eg: 2 ** 3 is 8 [ Basically it means 2*2*2 ]

Coming to Modulus: it returns the remainder of division.

For eg: 17 % 5 would be 2