ScriptCore: Use engine implementation of half to no longer rely on Half-Package

This commit is contained in:
Simon Lübeß
2023-12-17 18:47:07 +01:00
parent 64f7896c15
commit 6a87d1ac09
5 changed files with 321 additions and 6 deletions
+11 -1
View File
@@ -24,7 +24,7 @@ struct half : IFloating, ISigned, IFormattable, IHashable, IEquatable<half>, ICa
public bool IsNegative => (_data & Half_Sign_Mask) > 0;
public bool IsFinity => (_data & ~Half_Sign_Mask) < Half_Exponent_Mask;
public bool IsFinite => (_data & ~Half_Sign_Mask) < Half_Exponent_Mask;
public bool IsInfinity => (_data & ~Half_Sign_Mask) == Half_Exponent_Mask;
public bool IsPositiveInfinity => _data == PositiveInfinity._data;
@@ -299,6 +299,16 @@ struct half : IFloating, ISigned, IFormattable, IHashable, IEquatable<half>, ICa
return (half)((float)lhs % (float)rhs);
}
public static half operator ++(half value)
{
return (half)((float)value + 1.0f);
}
public static half operator --(half value)
{
return (half)((float)value - 1.0f);
}
public static bool operator==(half value1, half value2) => value1._data == value2._data;
public static bool operator!=(half value1, half value2) => value1._data != value2._data;