Division operation

Learn how to divide a value by another.

The division operation divides one numeric value by another and returns the quotient.

To use the division operator, place a / sign between two numeric values:

/*<operand>*/ / /*<operand>*/
Try in Playground

For a more natural reading, you can alternatively write:

/*<operand>*/ divided by /*<operand>*/
Try in Playground

Here is a practical example:

Note that division has the same precedence as multiplication, which is higher than addition and subtraction. This means that division is performed before those operations, as shown below:

2 + 6 / 2 // 5, not 4
Try in Playground