internal static void IsPredicateF16Kernel( Index1D index, ArrayView1D <int, Stride1D.Dense> data, Half value) { data[index + 0] = Half.IsFinite(value) ? 1 : 0; data[index + 1] = Half.IsInfinity(value) ? 1 : 0; data[index + 2] = Half.IsPositiveInfinity(value) ? 1 : 0; data[index + 3] = Half.IsNegativeInfinity(value) ? 1 : 0; data[index + 4] = Half.IsNaN(value) ? 1 : 0; }
public void IsNegativeInfinityTest() { { Half half = Half.NegativeInfinity; bool expected = true; bool actual = Half.IsNegativeInfinity(half); Assert.Equal(expected, actual); } { Half half = (Half)1234.5678f; bool expected = false; bool actual = Half.IsNegativeInfinity(half); Assert.Equal(expected, actual); } }
/// <summary> /// Returns a bvec3 from component-wise application of IsNegativeInfinity (Half.IsNegativeInfinity(v)). /// </summary> public static bool IsNegativeInfinity(Half v) => Half.IsNegativeInfinity(v);
public static void IsNegativeInfinity(Half value, bool expected) { Assert.Equal(expected, Half.IsNegativeInfinity(value)); }