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