Method

# Operator_IntegerDivideRight

<div class="rst-class">

forsearch

</div>

Operator

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Used to overload the `Integer Division</api/language/operators/mathematical/integer_division>` operator, providing custom functionality.Operator_IntegerDivideRight is the same as `Operator IntegerDivide</api/language/operators/operator_overloads/operator_divide>`, except that the intrinsic `Self</api/language/self_keyword>` is assumed to be the on the right in the division operation.

## Notes

Create an <span class="title-ref">Operator_IntegerDivideRight</span> function in a class to specify the functionality of the `Integer Division</api/language/operators/mathematical/integer_division>` operator for that class.

The ordinary methods are always preferred; the Right version is used only if there is no legal left version.

<div class="important">

<div class="title">

Important

</div>

This is not currently supported for Android.

</div>

## Sample code

Using the Vector class (see `Operator Add</api/language/operators/operator_overloads/operator_add>`) with two `Integer</api/data_types/integer>` elements, x and y, we define an <span class="title-ref">Operator_IntegerDivideRight</span> function that divides the sum of the passed instance by the sum of the `Self</api/language/self_keyword>` instance.

``` xojo
Function Operator_IntegerDivideRight(lhs As Vector) As Double
  Var a, b As Integer
  a = Self.x + Self.y
  b = lhs.x + lhs.y

  Return b \ a
End Function
```

## Compatibility

|                       |                               |
|-----------------------|-------------------------------|
| **Project Types**     | Console, Desktop, Mobile, Web |
| **Operating Systems** | iOS, Linux, macOS, Windows    |

<div class="seealso">

`Operator IntegerDivide</api/language/operators/operator_overloads/operator_integerdivide>` function.

</div>
