Table of Contents

Class NumericConversion

Namespace
ScottPlot
Assembly
ScottPlot.dll

This class contains type-specific methods to convert between generic values and doubles optimized for performance using platform-specific features. See discussion in https://github.com/ScottPlot/ScottPlot/pull/1927

public static class NumericConversion
Inheritance
NumericConversion
Inherited Members

Methods

AddBytes(byte, byte)

public static byte AddBytes(byte a, byte b)

Parameters

a byte
b byte

Returns

byte

AreReal(double, double)

public static bool AreReal(double x, double y)

Parameters

x double
y double

Returns

bool

Clamp(byte, byte, byte)

public static byte Clamp(byte value, byte min, byte max)

Parameters

value byte
min byte
max byte

Returns

byte

Clamp(decimal, decimal, decimal)

public static decimal Clamp(decimal value, decimal min, decimal max)

Parameters

value decimal
min decimal
max decimal

Returns

decimal

Clamp(double, double, double)

public static double Clamp(double value, double min, double max)

Parameters

value double
min double
max double

Returns

double

Clamp(short, short, short)

public static short Clamp(short value, short min, short max)

Parameters

value short
min short
max short

Returns

short

Clamp(int, int, int)

public static int Clamp(int value, int min, int max)

Parameters

value int
min int
max int

Returns

int

Clamp(long, long, long)

public static long Clamp(long value, long min, long max)

Parameters

value long
min long
max long

Returns

long

Clamp(sbyte, sbyte, sbyte)

public static sbyte Clamp(sbyte value, sbyte min, sbyte max)

Parameters

value sbyte
min sbyte
max sbyte

Returns

sbyte

Clamp(float, float, float)

public static float Clamp(float value, float min, float max)

Parameters

value float
min float
max float

Returns

float

Clamp(ushort, ushort, ushort)

public static ushort Clamp(ushort value, ushort min, ushort max)

Parameters

value ushort
min ushort
max ushort

Returns

ushort

Clamp(uint, uint, uint)

public static uint Clamp(uint value, uint min, uint max)

Parameters

value uint
min uint
max uint

Returns

uint

Clamp(ulong, ulong, ulong)

public static ulong Clamp(ulong value, ulong min, ulong max)

Parameters

value ulong
min ulong
max ulong

Returns

ulong

Clamp<T>(T, T, T)

public static T Clamp<T>(T input, T min, T max) where T : IComparable

Parameters

input T
min T
max T

Returns

T

Type Parameters

T

CreateAddFunction<T>()

public static Func<T, T, T> CreateAddFunction<T>()

Returns

Func<T, T, T>

Type Parameters

T

CreateLessThanOrEqualFunction<T>()

public static Func<T, T, bool> CreateLessThanOrEqualFunction<T>()

Returns

Func<T, T, bool>

Type Parameters

T

CreateMultFunction<T>()

public static Func<T, T, T> CreateMultFunction<T>()

Returns

Func<T, T, T>

Type Parameters

T

CreateSubtractFunction<T>()

public static Func<T, T, T> CreateSubtractFunction<T>()

Returns

Func<T, T, T>

Type Parameters

T

DecrementLargeDouble(double)

public static double DecrementLargeDouble(double value)

Parameters

value double

Returns

double

DoubleToGeneric<T>(double)

public static T DoubleToGeneric<T>(double value)

Parameters

value double

Returns

T

Type Parameters

T

DoubleToGeneric<T>(double, out T)

Creates a T for a given double value using a conversion technique optimized for the platform.

public static void DoubleToGeneric<T>(double value, out T v)

Parameters

value double
v T

Type Parameters

T

DoubleToGeneric<T>(double[])

public static T[] DoubleToGeneric<T>(this double[] input)

Parameters

input double[]

Returns

T[]

Type Parameters

T

GenericToCoordinates<T1, T2>(IEnumerable<T1>, IEnumerable<T2>)

public static Coordinates[] GenericToCoordinates<T1, T2>(IEnumerable<T1> xs, IEnumerable<T2> ys)

Parameters

xs IEnumerable<T1>
ys IEnumerable<T2>

Returns

Coordinates[]

Type Parameters

T1
T2

GenericToCoordinates<T1, T2>(ref T1, ref T2)

public static Coordinates GenericToCoordinates<T1, T2>(ref T1 x, ref T2 y)

Parameters

x T1
y T2

Returns

Coordinates

Type Parameters

T1
T2

GenericToDoubleArray<T>(IEnumerable<T>)

public static double[] GenericToDoubleArray<T>(IEnumerable<T> values)

Parameters

values IEnumerable<T>

Returns

double[]

Type Parameters

T

GenericToDoubleArray<T>(T[])

public static double[] GenericToDoubleArray<T>(T[] values)

Parameters

values T[]

Returns

double[]

Type Parameters

T

GenericToDouble<T>(IReadOnlyList<T>, int)

Returns the double value of the T at position i in list using a conversion technique optimized for the platform.

public static double GenericToDouble<T>(IReadOnlyList<T> list, int i)

Parameters

list IReadOnlyList<T>
i int

Returns

double

Type Parameters

T

GenericToDouble<T>(ref T)

Returns the double value of a T using a conversion technique optimized for the platform.

public static double GenericToDouble<T>(ref T value)

Parameters

value T

Returns

double

Type Parameters

T

GenericToDouble<T>(T[], int)

Returns the double value of the T at position i in array using a conversion technique optimized for the platform.

public static double GenericToDouble<T>(T[] array, int i)

Parameters

array T[]
i int

Returns

double

Type Parameters

T

IncrementLargeDouble(double)

public static double IncrementLargeDouble(double value)

Parameters

value double

Returns

double

IsReal(double)

public static bool IsReal(double x)

Parameters

x double

Returns

bool

IsReal(float)

public static bool IsReal(float x)

Parameters

x float

Returns

bool

LessThanOrEqualBytes(byte, byte)

public static bool LessThanOrEqualBytes(byte a, byte b)

Parameters

a byte
b byte

Returns

bool

Multiply(byte, byte)

public static byte Multiply(byte a, byte b)

Parameters

a byte
b byte

Returns

byte

SubtractBytes(byte, byte)

public static byte SubtractBytes(byte a, byte b)

Parameters

a byte
b byte

Returns

byte

ToDateTime(double)

public static DateTime ToDateTime(double value)

Parameters

value double

Returns

DateTime

ToGenericArray<T>(double[])

public static T[] ToGenericArray<T>(this double[] input)

Parameters

input double[]

Returns

T[]

Type Parameters

T

ToNumber(DateTime)

Convert a DateTime into a number that can be plotted on a numeric axis

public static double ToNumber(DateTime value)

Parameters

value DateTime

Returns

double