interface CanSubtract<T>
Interface CanSubtract<T>
specifies that a class can be subtracted by an object of type T
, producing a T
. This interface allows overloading of the binary -
operator. If the binary -
operator is applied, the appropriate subtract(T)
method will be called. Although this interface allows the binary -
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) |
subtract(T other) Method called when the binary |
public readonly subtract(T other) => (T)
Method called when the binary -
operator is overloaded.
other
- object to subtract by
result of the subtraction