Esempio n. 1
0
 public static Half FmaFP32(Half first, Half second, Half third) =>
 (Half)((float)first * second + third);
Esempio n. 2
0
 public static ushort FloatAsInt(Half value) =>
 value.RawValue;
Esempio n. 3
0
 public static Half MulFP32(Half first, Half second) =>
 (Half)((float)first * second);
Esempio n. 4
0
 public static Half DivFP32(Half first, Half second) =>
 (Half)((float)first / second);
Esempio n. 5
0
 public static Half AddFP32(Half first, Half second) =>
 (Half)((float)first + second);
Esempio n. 6
0
 public static Half SubFP32(Half first, Half second) =>
 (Half)((float)first - second);
Esempio n. 7
0
 public static bool IsInfinity(Half half) =>
 (half.RawValue & ExponentMantissaMask) == ExponentMask;
Esempio n. 8
0
 public static bool IsFinite(Half half) => !IsNaN(half) & !IsInfinity(half);
Esempio n. 9
0
 public static bool IsPositiveInfinity(Half half) =>
 half == Half.PositiveInfinity;
Esempio n. 10
0
 public static bool IsNegativeInfinity(Half half) =>
 half == Half.NegativeInfinity;
Esempio n. 11
0
 public static bool IsZero(Half half) =>
 (half.RawValue & ExponentMantissaMask) == 0;
Esempio n. 12
0
 public static bool IsNaN(Half half) =>
 (half.RawValue & ExponentMantissaMask) > ExponentMask;
Esempio n. 13
0
 public static Half Abs(Half half) =>
 new Half((ushort)(half.RawValue & ExponentMantissaMask));
Esempio n. 14
0
 public static Half Neg(Half halfValue) =>
 new Half((ushort)(halfValue.RawValue ^ SignBitMask));
Esempio n. 15
0
 public static Half Abs(Half value) =>
 Half.Abs(value);