1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-27 20:18:01 +02:00

Merge pull request #329 from MineGame159/master

Added IOpMultiplicable and IOpDividable, fixed Double not implementing IOpAddable and IOpSubtractable
This commit is contained in:
Brian Fiete 2020-06-05 07:03:20 -07:00 committed by GitHub
commit bc64ac4d78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 151 additions and 11 deletions

View file

@ -1,6 +1,6 @@
namespace System
{
struct UInt8 : uint8, IInteger, IUnsigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable
struct UInt8 : uint8, IInteger, IUnsigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable
{
public const uint8 MaxValue = (uint8)0xFF;
public const uint8 MinValue = 0;
@ -25,6 +25,16 @@ namespace System
return (SelfBase)value;
}
public static Self operator*(Self lhs, Self rhs)
{
return (SelfBase)lhs * (SelfBase)rhs;
}
public static Self operator/(Self lhs, Self rhs)
{
return (SelfBase)lhs / (SelfBase)rhs;
}
public int GetHashCode()
{
return (int)this;