Corrected operators for uchar to use the internal type for operations, defined int8_t compat type
This commit is contained in:
@@ -19,16 +19,16 @@ public readonly struct uchar {
|
||||
public static explicit operator int(uchar value) => value._value;
|
||||
public static implicit operator uchar(int value) => new((byte)value);
|
||||
|
||||
public static uchar operator +(uchar left, uchar right) => left.Value + right.Value;
|
||||
public static uchar operator -(uchar left, uchar right) => left.Value - right.Value;
|
||||
public static uchar operator *(uchar left, uchar right) => left.Value * right.Value;
|
||||
public static uchar operator /(uchar left, uchar right) => left.Value / right.Value;
|
||||
public static uchar operator %(uchar left, uchar right) => left.Value % right.Value;
|
||||
public static uchar operator &(uchar left, uchar right) => left.Value & right.Value;
|
||||
public static uchar operator |(uchar left, uchar right) => left.Value | right.Value;
|
||||
public static uchar operator ^(uchar left, uchar right) => left.Value ^ right.Value;
|
||||
public static uchar operator <<(uchar left, byte right) => left.Value << right;
|
||||
public static uchar operator >>(uchar left, byte right) => left.Value >> right;
|
||||
public static uchar operator ++(uchar value) => new (value.Value + 1);
|
||||
public static uchar operator --(uchar value) => new (value.Value - 1);
|
||||
public static uchar operator +(uchar left, uchar right) => left._value + right._value;
|
||||
public static uchar operator -(uchar left, uchar right) => left._value - right._value;
|
||||
public static uchar operator *(uchar left, uchar right) => left._value * right._value;
|
||||
public static uchar operator /(uchar left, uchar right) => left._value / right._value;
|
||||
public static uchar operator %(uchar left, uchar right) => left._value % right._value;
|
||||
public static uchar operator &(uchar left, uchar right) => left._value & right._value;
|
||||
public static uchar operator |(uchar left, uchar right) => left._value | right._value;
|
||||
public static uchar operator ^(uchar left, uchar right) => left._value ^ right._value;
|
||||
public static uchar operator <<(uchar left, byte right) => left._value << right;
|
||||
public static uchar operator >>(uchar left, byte right) => left._value >> right;
|
||||
public static uchar operator ++(uchar value) => new (value._value + 1);
|
||||
public static uchar operator --(uchar value) => new (value._value - 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user