IMath

StockSharp.Xaml.Charting.Numerics.GenericMath

Defines the interface to a generic math helper

Properties

MaxValue
public T MaxValue { get; }
value = iMath.MaxValue

Gets the MaxValue for T.

MinValue
public T MinValue { get; }
value = iMath.MinValue

Gets the MinValue for T. for DateTime it returns DateTime.MinValue (it has .Ticks = 0)

ZeroValue
public T ZeroValue { get; }
value = iMath.ZeroValue

Gets the ZeroValue for T. for DateTime it returns DateTime.MinValue (it has .Ticks = 0)

Methods

Abs
public T Abs(T a)
result = iMath.Abs(a)

Get the Absolute value of (a)

Add
public T Add(T lhs, T rhs)
result = iMath.Add(lhs, rhs)

Adds lhs + rhs. for DateTime it returns a new DateTime with .Ticks = lhs.Ticks + rhs.Ticks

Dec
public T Dec(T value)
result = iMath.Dec(value)

Returns T-- for DateTime it decrements .Ticks

Inc
public T Inc(T value)
result = iMath.Inc(value)

Returns T++ for DateTime it increments .Ticks

IsNaN
public bool IsNaN(T value)
result = iMath.IsNaN(value)

Returns if T is NaN. Only valid for Float, Double types. For all other types, always returns false

Max
public T Max(T a, T b)
result = iMath.Max(a, b)

Returns the Max of A and B

Min
public T Min(T a, T b)
result = iMath.Min(a, b)

Returns the Min of A and B

MinGreaterThan
public T MinGreaterThan(T floor, T a, T b)
result = iMath.MinGreaterThan(floor, a, b)

Returns the Min of A and B greater than a Floor

Mult
public T Mult(T lhs, T rhs)
result = iMath.Mult(lhs, rhs)

Multiplies lhs * rhs

Mult
public T Mult(T lhs, double rhs)
result = iMath.Mult(lhs, rhs)

Multiplies lhs * rhs

Subtract
public T Subtract(T a, T b)
result = iMath.Subtract(a, b)

Subtracts a - b. For DateTime it returns a new DateTime with .Ticks = a.Ticks - b.Ticks

ToDouble
public double ToDouble(T value)
result = iMath.ToDouble(value)

Converts to the equivalent value as a double