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