25 implementations of IsZero
System.Private.CoreLib (22)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (1)
662static bool INumberBase<byte>.IsZero(byte value) => (value == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
1542static bool INumberBase<char>.IsZero(char value) => (value == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (1)
1420static bool INumberBase<decimal>.IsZero(decimal value) => (value == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (1)
1151static bool INumberBase<double>.IsZero(double value) => IsZero(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (1)
1845static bool INumberBase<Half>.IsZero(Half value) => IsZero(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int128.cs (1)
1390static bool INumberBase<Int128>.IsZero(Int128 value) => (value == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
762static bool INumberBase<short>.IsZero(short value) => (value == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
804static bool INumberBase<int>.IsZero(int value) => (value == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (1)
801static bool INumberBase<long>.IsZero(long value) => (value == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (1)
820static bool INumberBase<nint>.IsZero(nint value) => (value == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BFloat16.cs (1)
1488static bool INumberBase<BFloat16>.IsZero(BFloat16 value) => IsZero(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal128.cs (1)
927static bool INumberBase<Decimal128>.IsZero(Decimal128 value) => Number.IsZeroDecimalIeee754<Decimal128, UInt128>(new UInt128(value._upper, value._lower));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal32.cs (1)
951static bool INumberBase<Decimal32>.IsZero(Decimal32 value) => Number.IsZeroDecimalIeee754<Decimal32, uint>(value._value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal64.cs (1)
942static bool INumberBase<Decimal64>.IsZero(Decimal64 value) => Number.IsZeroDecimalIeee754<Decimal64, ulong>(value._value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (1)
1302static bool INumberBase<NFloat>.IsZero(NFloat value) => (value == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
741static bool INumberBase<sbyte>.IsZero(sbyte value) => (value == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (1)
1168static bool INumberBase<float>.IsZero(float value) => IsZero(value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (1)
1585static bool INumberBase<UInt128>.IsZero(UInt128 value) => (value == 0U);
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
667static bool INumberBase<ushort>.IsZero(ushort value) => (value == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (1)
732static bool INumberBase<uint>.IsZero(uint value) => (value == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (1)
739static bool INumberBase<ulong>.IsZero(ulong value) => (value == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (1)
734static bool INumberBase<nuint>.IsZero(nuint value) => (value == 0);
System.Runtime.Numerics (3)
System\Numerics\BigInteger.cs (1)
4239static bool INumberBase<BigInteger>.IsZero(BigInteger value)
System\Numerics\Complex.cs (1)
675static bool INumberBase<Complex>.IsZero(Complex value) => (value.m_real == 0.0) && (value.m_imaginary == 0.0);
System\Numerics\Complex.Generic.cs (1)
885static bool INumberBase<Complex<T>>.IsZero(Complex<T> value) => (value.m_real == T.Zero) && (value.m_imaginary == T.Zero);
70 references to IsZero
System.Linq (1)
System\Linq\Sequence.cs (1)
61if (T.IsZero(step))
System.Linq.AsyncEnumerable (1)
System\Linq\Sequence.cs (1)
61if (T.IsZero(step))
System.Numerics.Tensors (1)
System\Numerics\Tensors\netcore\TensorPrimitives.IsZero.cs (1)
49public static bool Invoke(T x) => T.IsZero(x);
System.Private.CoreLib (62)
src\runtime\src\libraries\System.Private.CoreLib\src\System\ArgumentOutOfRangeException.cs (2)
132if (T.IsZero(value)) 152if (T.IsNegative(value) || T.IsZero(value))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (1)
661/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
1541/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (1)
1419/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.DecCalc.cs (1)
1590if (TNumber.IsZero(input))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (1)
1150/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (1)
1844/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int128.cs (1)
1389/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
761/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
803/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (1)
800/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (1)
819/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.DecimalIeee754.cs (32)
428if (TValue.IsZero(significand)) 648bool aZero = TValue.IsZero(a.Significand); 649bool bZero = TValue.IsZero(b.Significand); 723sticky = !TValue.IsZero(remainder); 748int comparison = !TValue.IsZero(magnitudeHigh) ? 1 : magnitudeLow.CompareTo(loRetained); 763if (TValue.IsZero(magnitudeLow)) 785if (TValue.IsZero(magnitudeHigh) && TValue.IsZero(magnitudeLow) && !sticky) 855bool otherZero = (leftInfinity && !rightInfinity && TValue.IsZero(UnpackDecimalIeee754<TDecimal, TValue>(right).Significand)) 856|| (rightInfinity && !leftInfinity && TValue.IsZero(UnpackDecimalIeee754<TDecimal, TValue>(left).Significand)); 874if (TValue.IsZero(a.Significand) || TValue.IsZero(b.Significand)) 946if (TValue.IsZero(b.Significand)) 950if (TValue.IsZero(a.Significand)) 961if (TValue.IsZero(a.Significand)) 993bool remainderNonZero = !TValue.IsZero(remainder); 1005if (!TValue.IsZero(digit)) 1106if (TValue.IsZero(high)) 1156while (!TValue.IsZero(high)) 1236Debug.Assert(TValue.IsZero(high)); 1251if (TValue.IsZero(high) && TValue.IsZero(low)) 1402if (TValue.IsZero(significand)) 1432if (!TValue.IsZero(remainder)) 1471return TValue.IsZero(decoded.Significand); 1532if (TValue.IsZero(decoded.Significand)) 1556if (TValue.IsZero(decoded.Significand)) 1763if (TDecimal.IsFinite(decimalBits) && TValue.IsZero(UnpackDecimalIeee754<TDecimal, TValue>(decimalBits).Significand)) 1869bool isUnsigned = TInteger.IsZero(TInteger.MinValue); 2045if (TSourceValue.IsZero(decoded.Significand)) 2078if (TValue.IsZero(decoded.Significand)) 2169if (TValue.IsZero(decoded.Significand))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (1)
492if (TValue.IsZero(unpackDecimal.Significand))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BFloat16.cs (1)
1487/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal128.cs (1)
926/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal32.cs (1)
950/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal64.cs (1)
941/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\IBinaryInteger.cs (3)
32if (TSelf.IsZero(remainder)) 116if (TSelf.IsZero(remainder)) 194if (TSelf.IsZero(remainder))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\TotalOrderIeee754Comparer.cs (1)
112if (T.IsZero(x)) // only zeros are equal to zeros
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (1)
1301/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
740/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (1)
1167/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (1)
1584/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
666/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (1)
731/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (1)
738/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (1)
733/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
System.Private.Windows.Core.TestUtilities (2)
ComparisonHelpers.cs (2)
109static unsafe bool IsNegativeZero(T value) => T.IsZero(value) && T.IsNegative(value); 111static unsafe bool IsPositiveZero(T value) => T.IsZero(value) && T.IsPositive(value);
System.Runtime.Numerics (3)
System\Numerics\BigInteger.cs (1)
4238/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
System\Numerics\Complex.cs (1)
674/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />
System\Numerics\Complex.Generic.cs (1)
884/// <inheritdoc cref="INumberBase{TSelf}.IsZero(TSelf)" />