Table of Contents

Class BaseOperator<T>

Namespace
Ecng.Common
Assembly
Ecng.Common.dll

Provides a base implementation for arithmetic operators.

public abstract class BaseOperator<T> : IOperator<T>, IComparer<T>, IOperator, IComparer

Type Parameters

T

The type to operate on.

Inheritance
BaseOperator<T>
Implements
Derived
Inherited Members
Extension Methods

Constructors

BaseOperator()

protected BaseOperator()

Methods

Add(T, T)

Adds two values.

public abstract T Add(T first, T second)

Parameters

first T

The first value.

second T

The second value.

Returns

T

The result of addition.

Compare(T, T)

Compares two values.

public abstract int Compare(T x, T y)

Parameters

x T

The first value.

y T

The second value.

Returns

int

A value indicating the relative order.

Divide(T, T)

Divides the first value by the second.

public abstract T Divide(T first, T second)

Parameters

first T

The first value.

second T

The second value.

Returns

T

The result of division.

Multiply(T, T)

Multiplies two values.

public abstract T Multiply(T first, T second)

Parameters

first T

The first value.

second T

The second value.

Returns

T

The result of multiplication.

Subtract(T, T)

Subtracts the second value from the first.

public abstract T Subtract(T first, T second)

Parameters

first T

The first value.

second T

The second value.

Returns

T

The result of subtraction.