Method

Operator_IntegerDivideRight

Operator


Description

Used to overload the Integer Division operator, providing custom functionality.Operator_IntegerDivideRight is the same as Operator IntegerDivide, except that the intrinsic Self is assumed to be the on the right in the division operation.

Notes

Create an Operator_IntegerDivideRight function in a class to specify the functionality of the 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.

Important

This is not currently supported for Android.

Sample code

Using the Vector class (see Operator Add) with two Integer elements, x and y, we define an Operator_IntegerDivideRight function that divides the sum of the passed instance by the sum of the Self instance.

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

See also

Operator IntegerDivide function.