1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-14 14:24:10 +02:00

Update Float.bf

Implement IOpAddable and IOpSubtractable.
This commit is contained in:
Damian Day 2020-04-08 18:16:23 +01:00
parent 371f649fba
commit ac65cc2dde

View file

@ -2,7 +2,7 @@ using System.Globalization;
namespace System namespace System
{ {
struct Float : float, IFloating, ISigned, IFormattable, IHashable, IEquatable<float>, IOpComparable, IOpNegatable, ICanBeNaN struct Float : float, IFloating, ISigned, IFormattable, IHashable, IEquatable<float>, IOpComparable, IOpNegatable, IOpAddable, IOpSubtractable, ICanBeNaN
{ {
public const float MinValue = (float)-3.40282346638528859e+38; public const float MinValue = (float)-3.40282346638528859e+38;
public const float Epsilon = (float)1.4e-45; public const float Epsilon = (float)1.4e-45;
@ -24,6 +24,16 @@ namespace System
return (float)value; return (float)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 bool IsNegative /*public bool IsNegative
{ {
get get