1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Aded operators to create numerics

This commit is contained in:
Darth Affe 2022-08-21 23:48:24 +02:00
parent da0d3abbdd
commit 3f9de63b06

View File

@ -159,7 +159,12 @@ public readonly struct Numeric : IComparable<Numeric>, IConvertible
{
return (byte) Math.Clamp(p._value, 0, 255);
}
public static implicit operator Numeric(double d) => new(d);
public static implicit operator Numeric(float f) => new(f);
public static implicit operator Numeric(int i) => new(i);
public static implicit operator Numeric(byte b) => new(b);
public static implicit operator long(Numeric p)
{
return (long) p._value;