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