mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-24 02:28:01 +02:00
Added IOpMultiplicable and IOpDividable, fixed Double not implementing IOpAddable and IOpSubtractable
This commit is contained in:
parent
5d9a5f183d
commit
862c15241a
13 changed files with 151 additions and 11 deletions
|
@ -9,7 +9,7 @@ namespace System
|
|||
using System.Diagnostics.Contracts;
|
||||
using System.Diagnostics;
|
||||
|
||||
public struct Double : double, IFloating, ISigned, IFormattable, IHashable, IOpComparable, IOpNegatable, ICanBeNaN
|
||||
public struct Double : double, IFloating, ISigned, IFormattable, IHashable, IOpComparable, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable, ICanBeNaN
|
||||
{
|
||||
public const double MinValue = -1.7976931348623157E+308;
|
||||
public const double MaxValue = 1.7976931348623157E+308;
|
||||
|
@ -33,6 +33,26 @@ namespace System
|
|||
return (double)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 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()
|
||||
{
|
||||
double d = (double)this;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue