# divrem

divrem(x, y)

The quotient and remainder from Euclidean division. Equivalent to `(xÃ·y, x%y)`.

## Examples

1. Calculate quotient and remainder:

``````julia> divrem(17, 5)
(3, 2)``````

This example calculates the quotient and remainder of 17 divided by 5. The quotient is 3, and the remainder is 2.

2. Handle negative numbers:

``````julia> divrem(-10, 3)
(-3, -1)``````

It handles negative numbers correctly. In this example, -10 divided by 3 gives a quotient of -3 and a remainder of -1.

3. Divide by zero:

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

When dividing by zero, it throws a `DivideError` indicating an integer division error.

4. Divide non-integer values:
``````julia> divrem(10.5, 2.2)
(4.0, 2.0999999999999996)``````

The `divrem` function can also be used to divide non-integer values. In this example, 10.5 divided by 2.2 gives a quotient of 4.0 and a remainder of 2.0999999999999996.

Common mistake example:

``````julia> divrem(10, "2")
ERROR: MethodError: no method matching divrem(::Int64, ::String)``````

In this example, the function is called with non-numeric arguments. The `divrem` function expects numeric arguments, so make sure to provide appropriate numerical values to avoid such errors.