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:
parent
da0d3abbdd
commit
3f9de63b06
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user