# div

div(x, y) Ã·(x, y)

The quotient from Euclidean division. Computes `x/y`, truncated to an integer.

## Examples

1. Perform Euclidean division:

``````julia> div(10, 3)
3``````

This example performs Euclidean division of 10 by 3, resulting in the quotient 3.

2. Handle negative numbers:

``````julia> div(-10, 3)
-3``````

The `div` function can handle negative numbers as well. In this example, it computes the quotient of -10 divided by 3, resulting in -3.

3. Truncate decimal values:
``````julia> div(17, 5)
3``````

The `div` function truncates the decimal part of the division result. Here, 17 divided by 5 is 3.4, but the decimal part is discarded, resulting in the quotient 3.

Common mistake example:

``````julia> div(10, 0)
ERROR: DivideError: integer division error``````

In this example, division by zero is attempted, which is not allowed. It's important to ensure that the divisor (`y`) is not zero to avoid such errors. Always make sure the divisor is a non-zero value when using the `div` function.