interface CanDivide<T>
Interface CanDivide<T>
specifies that a class can be divided by an object of type T
, producing a T
. This interface allows overloading of the /
operator. If the /
operator is applied, the appropriate divide(T)
method will be called. Although this interface allows the /
operator to be overloaded with arbitrary functionality for any class, it is intended to make operations between numerical classes more readable.
Modifiers | Return Types | Method and Description |
---|---|---|
public readonly |
(T) |
divide(T other) Method called when the |
public readonly divide(T other) => (T)
Method called when the /
operator is overloaded.
other
- object to divide by
quotient of the division