Struct Numeric
Represents a number, either decimal or not, with arbitrary precision.
Note: This struct is intended to be used by the node system when implementing your own Node.
Usage outside that context is not recommended due to conversion overhead.
Assembly: Artemis.Core.dll
Syntax
public readonly struct Numeric : IComparable<Numeric>, IConvertible
Constructors
Numeric(byte)
Declaration
public Numeric(byte value)
Parameters
Type |
Name |
Description |
byte |
value |
|
Numeric(double)
Declaration
public Numeric(double value)
Parameters
Type |
Name |
Description |
double |
value |
|
Numeric(int)
Declaration
public Numeric(int value)
Parameters
Type |
Name |
Description |
int |
value |
|
Numeric(long)
Declaration
public Numeric(long value)
Parameters
Type |
Name |
Description |
long |
value |
|
Numeric(object?)
Declaration
public Numeric(object? pathValue)
Parameters
Type |
Name |
Description |
object |
pathValue |
|
Numeric(float)
Declaration
public Numeric(float value)
Parameters
Type |
Name |
Description |
float |
value |
|
Methods
CompareTo(Numeric)
Declaration
public int CompareTo(Numeric other)
Parameters
Type |
Name |
Description |
Numeric |
other |
|
Returns
Equals(Numeric)
Indicates whether this instance and a specified numeric are equal
Declaration
public bool Equals(Numeric other)
Parameters
Type |
Name |
Description |
Numeric |
other |
The numeric to compare with the current instance
|
Returns
Type |
Description |
bool |
true if this numeric and the provided other are equal; otherwise,
false.
|
Equals(object?)
Declaration
public override bool Equals(object? obj)
Parameters
Type |
Name |
Description |
object |
obj |
|
Returns
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
GetTypeCode()
Declaration
public TypeCode GetTypeCode()
Returns
IsTypeCompatible(Type?)
Returns a boolean indicating whether the provided type can be used as a Numeric.
Declaration
public static bool IsTypeCompatible(Type? type)
Parameters
Type |
Name |
Description |
Type |
type |
|
Returns
Declaration
public bool ToBoolean(IFormatProvider? provider)
Parameters
Returns
Declaration
public byte ToByte(IFormatProvider? provider)
Parameters
Returns
Declaration
public char ToChar(IFormatProvider? provider)
Parameters
Returns
Declaration
public DateTime ToDateTime(IFormatProvider? provider)
Parameters
Returns
Declaration
public decimal ToDecimal(IFormatProvider? provider)
Parameters
Returns
Declaration
public double ToDouble(IFormatProvider? provider)
Parameters
Returns
Declaration
public short ToInt16(IFormatProvider? provider)
Parameters
Returns
Declaration
public int ToInt32(IFormatProvider? provider)
Parameters
Returns
Declaration
public long ToInt64(IFormatProvider? provider)
Parameters
Returns
Declaration
public sbyte ToSByte(IFormatProvider? provider)
Parameters
Returns
Declaration
public float ToSingle(IFormatProvider? provider)
Parameters
Returns
ToString()
Declaration
public override string ToString()
Returns
Overrides
Declaration
public string ToString(IFormatProvider? provider)
Parameters
Returns
Declaration
public object ToType(Type conversionType, IFormatProvider? provider)
Parameters
Returns
Declaration
public ushort ToUInt16(IFormatProvider? provider)
Parameters
Returns
Declaration
public uint ToUInt32(IFormatProvider? provider)
Parameters
Returns
Declaration
public ulong ToUInt64(IFormatProvider? provider)
Parameters
Returns
TryParse(string?, out Numeric)
Converts the string representation of a number into a numeric. A return value indicates whether the conversion
succeeded or failed.
Declaration
public static bool TryParse(string? s, out Numeric result)
Parameters
Type |
Name |
Description |
string |
s |
A string representing a number to convert.
|
Numeric |
result |
When this method returns, contains numeric equivalent to the numeric value or symbol contained in
s , if the conversion succeeded, or zero if the conversion failed.
|
Returns
Type |
Description |
bool |
true if s was converted successfully; otherwise, false.
|
Operators
operator +(Numeric, Numeric)
Declaration
public static Numeric operator +(Numeric a, Numeric b)
Parameters
Returns
operator --(Numeric)
Declaration
public static Numeric operator --(Numeric a)
Parameters
Returns
operator /(Numeric, Numeric)
Declaration
public static Numeric operator /(Numeric a, Numeric b)
Parameters
Returns
operator ==(Numeric, Numeric)
Declaration
public static bool operator ==(Numeric left, Numeric right)
Parameters
Returns
operator >(Numeric, Numeric)
Declaration
public static bool operator >(Numeric a, Numeric b)
Parameters
Returns
operator >=(Numeric, Numeric)
Declaration
public static bool operator >=(Numeric left, Numeric right)
Parameters
Returns
implicit operator byte(Numeric)
Declaration
public static implicit operator byte(Numeric p)
Parameters
Returns
implicit operator decimal(Numeric)
Declaration
public static implicit operator decimal(Numeric p)
Parameters
Returns
implicit operator double(Numeric)
Declaration
public static implicit operator double(Numeric p)
Parameters
Returns
implicit operator int(Numeric)
Declaration
public static implicit operator int(Numeric p)
Parameters
Returns
implicit operator long(Numeric)
Declaration
public static implicit operator long(Numeric p)
Parameters
Returns
implicit operator float(Numeric)
Declaration
public static implicit operator float(Numeric p)
Parameters
Returns
implicit operator Numeric(byte)
Declaration
public static implicit operator Numeric(byte b)
Parameters
Type |
Name |
Description |
byte |
b |
|
Returns
implicit operator Numeric(double)
Declaration
public static implicit operator Numeric(double d)
Parameters
Type |
Name |
Description |
double |
d |
|
Returns
implicit operator Numeric(int)
Declaration
public static implicit operator Numeric(int i)
Parameters
Type |
Name |
Description |
int |
i |
|
Returns
implicit operator Numeric(float)
Declaration
public static implicit operator Numeric(float f)
Parameters
Type |
Name |
Description |
float |
f |
|
Returns
operator ++(Numeric)
Declaration
public static Numeric operator ++(Numeric a)
Parameters
Returns
operator !=(Numeric, Numeric)
Declaration
public static bool operator !=(Numeric left, Numeric right)
Parameters
Returns
operator <(Numeric, Numeric)
Declaration
public static bool operator <(Numeric a, Numeric b)
Parameters
Returns
operator <=(Numeric, Numeric)
Declaration
public static bool operator <=(Numeric left, Numeric right)
Parameters
Returns
operator %(Numeric, Numeric)
Declaration
public static Numeric operator %(Numeric a, Numeric b)
Parameters
Returns
operator *(Numeric, Numeric)
Declaration
public static Numeric operator *(Numeric a, Numeric b)
Parameters
Returns
operator -(Numeric, Numeric)
Declaration
public static Numeric operator -(Numeric a, Numeric b)
Parameters
Returns
operator -(Numeric)
Declaration
public static Numeric operator -(Numeric a)
Parameters
Returns
operator +(Numeric)
Declaration
public static Numeric operator +(Numeric a)
Parameters
Returns
Implements