34,333
edits
Changes
→Performing Arithmetic using Operators
</pre>
== Performing Ruby Arithmetic using Operators ==
Ruby provides a number of basic operators for performing arithmetic. These are as follows:
<table border="1" cellspacing="0">
<tr style="background:#efefef;">
<th>Operator</th><th>Description</th>
<tr>
<td>+<td>Addition - Adds values on either side of the operator </td>
<tr>
<td>-<td>Subtraction - Subtracts right hand operand from left hand operand </td>
<tr>
<td>*<td>Multiplication - Multiplies values on either side of the operator </td>
<tr>
<td>/<td>Division - Divides left hand operand by right hand operand</td>
<tr>
<td>%<td>Modulus - Divides left hand operand by right hand operand and returns remainder</td>
<tr>
<td>**<td>Exponent - Peforms exponential calculation on operators</td>
</tr>
</table>