16 implementations of One
System.Private.CoreLib (15)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (1)
545static byte INumberBase<byte>.One => One;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
1482static char INumberBase<char>.One => (char)1;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (1)
1272static decimal INumberBase<decimal>.One => One;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (1)
1049static double INumberBase<double>.One => One;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
645static short INumberBase<short>.One => One;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
687static int INumberBase<int>.One => One;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (1)
684static long INumberBase<long>.One => One;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (1)
703static nint INumberBase<nint>.One => 1;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (1)
1209static NFloat INumberBase<NFloat>.One => new NFloat(NativeType.One);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
624static sbyte INumberBase<sbyte>.One => One;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (1)
1046static float INumberBase<float>.One => One;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
550static ushort INumberBase<ushort>.One => One;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (1)
615static uint INumberBase<uint>.One => One;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (1)
622static ulong INumberBase<ulong>.One => One;
src\runtime\src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (1)
617static nuint INumberBase<nuint>.One => 1;
System.Runtime.Numerics (1)
System\Numerics\Complex.cs (1)
530static Complex INumberBase<Complex>.One => new(1.0, 0.0);
151 references to One
Microsoft.Diagnostics.DataContractReader.Contracts (2)
Contracts\EcmaMetadata_1.cs (2)
340return input + (alignment - T.One) & ~(alignment - T.One);
System.Linq (5)
System\Linq\Range.SpeedOpt.cs (1)
71return _endExclusive - T.One;
System\Linq\Select.SpeedOpt.cs (1)
377return _selector(_end - T.One);
System\Linq\Sequence.cs (3)
113if (step == T.One && 114TLarger.CreateTruncating(endInclusive) - TLarger.CreateTruncating(start) + TLarger.One <= maxValue) 116return new RangeIterator<T>(start, endInclusive + T.One);
System.Numerics.Tensors (14)
System\Numerics\Tensors\netcore\TensorOperation.cs (3)
1808destination = T.One / x; 1937destination = T.One / (T.One + T.Exp(-x));
System\Numerics\Tensors\netcore\TensorPrimitives.DivRem.cs (1)
102public static T RemainderMaskValue => T.One;
System\Numerics\Tensors\netcore\TensorPrimitives.Reciprocal.cs (2)
103public static T Invoke(T x) => T.One / x; 112public static T Invoke(T x) => T.One / T.Sqrt(x);
System\Numerics\Tensors\netcore\TensorPrimitives.Sigmoid.cs (8)
45public static T Invoke(T x) => T.One / (T.One + T.Exp(-x)); 46public static Vector128<T> Invoke(Vector128<T> x) => Vector128.Create(T.One) / (Vector128.Create(T.One) + ExpOperator<T>.Invoke(-x)); 47public static Vector256<T> Invoke(Vector256<T> x) => Vector256.Create(T.One) / (Vector256.Create(T.One) + ExpOperator<T>.Invoke(-x)); 48public static Vector512<T> Invoke(Vector512<T> x) => Vector512.Create(T.One) / (Vector512.Create(T.One) + ExpOperator<T>.Invoke(-x));
System.Private.CoreLib (83)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Byte.cs (1)
544/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
1481/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (1)
1271/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (1)
1048/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (1)
1743/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int128.cs (1)
1260/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (1)
644/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (1)
686/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (1)
683/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (1)
702/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.DecimalIeee754.cs (39)
478return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(coefficient.IsNegative, TValue.One, TDecimal.MinAdjustedExponent); 483? DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(coefficient.IsNegative, TValue.One, TDecimal.MinAdjustedExponent) 560significand += TValue.One; 590TValue payload = nanBits & ((TValue.One << TDecimal.NumberBitsSignificand) - TValue.One); 751magnitudeHigh += TValue.One; 766magnitudeHigh -= TValue.One; 777magnitudeHigh -= TValue.One; 779magnitudeLow -= TValue.One; 1061resultHigh += TValue.One; 1095resultHigh -= TValue.One; 1098resultLow -= TValue.One; 1444quotientIsOdd = !TValue.IsZero(quotient & TValue.One); 1463quotientIsOdd = !TValue.IsZero(quotient & TValue.One); 1632MidpointRounding.ToEven => (discardedComparedToHalf > 0) || ((discardedComparedToHalf == 0) && !TValue.IsZero(quotient & TValue.One)), 1642quotient += TValue.One; 1755if ((discardedComparedToHalf > 0) || ((discardedComparedToHalf == 0) && !TValue.IsZero(quotient & TValue.One))) 1757quotient += TValue.One; 1861if ((discardedComparedToHalf > 0) || ((discardedComparedToHalf == 0) && !TValue.IsZero(quotient & TValue.One))) 1863quotient += TValue.One; 1895return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: false, TValue.One, a.UnbiasedExponent); 1958return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: false, TValue.One, TDecimal.MinAdjustedExponent); 1969if (a.Signed && (a.Significand == TValue.One) && (exponent == TDecimal.MinAdjustedExponent)) 1989significand += TValue.One; 2000significand -= TValue.One; 2002if ((significand == (TDecimal.Power10(TDecimal.Precision - 1) - TValue.One)) && (exponent != TDecimal.MinAdjustedExponent)) 2037TValue result = TValue.One; 2076TValue lowMask = (TValue.One << half) - TValue.One; 2196high -= TValue.One; 2228TValue lowMask = (TValue.One << half) - TValue.One; 2229TValue baseValue = TValue.One << half; 2305TValue trial = (root << 1) | TValue.One; 2310root += TValue.One; 2509significand += TValue.One; 2526TValue significand = ((leadDigit > 5) || ((leadDigit == 5) && restNonZero)) ? TValue.One : TValue.Zero; 2570return int.CreateTruncating(significand & TValue.One); 2589return int.CreateTruncating(quotient & TValue.One);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Parsing.cs (1)
505overflow |= TInteger.IsGreaterThanAsUnsigned(answer, TInteger.MaxValue + (isNegative ? TInteger.One : TInteger.Zero));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Rounding.cs (4)
53TNumber one = TNumber.One; 221TUInt half = TUInt.One << (bitWidth - 1); 233if (integerPart >= (TUInt.One << integerBoundaryLog2)) 244TUInt half2 = TUInt.One << (shift - 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BFloat16.cs (4)
517TInteger lower = value & ((TInteger.One << trailingLength) - TInteger.One); 522TInteger lowerShift = (~upper) & (lower >>> (trailingLength - 1)) & TInteger.One; // Upper is even & lower>=midpoint (not 0) 1386/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\IBinaryInteger.cs (1)
309return TSelf.IsNegative(value) ? TSelf.Zero : ((bitCount - TSelf.One) ^ TSelf.Log2(value));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\IExponentialFunctions.cs (3)
20static virtual TSelf ExpM1(TSelf x) => TSelf.Exp(x) - TSelf.One; 30static virtual TSelf Exp2M1(TSelf x) => TSelf.Exp2(x) - TSelf.One; 40static virtual TSelf Exp10M1(TSelf x) => TSelf.Exp10(x) - TSelf.One;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\IFloatingPointIeee754.cs (3)
81static virtual TSelf Lerp(TSelf value1, TSelf value2, TSelf amount) => TSelf.MultiplyAddEstimate(value1, TSelf.One - amount, value2 * amount); 86static virtual TSelf ReciprocalEstimate(TSelf x) => TSelf.One / x; 91static virtual TSelf ReciprocalSqrtEstimate(TSelf x) => TSelf.One / TSelf.Sqrt(x);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\ILogarithmicFunctions.cs (3)
26static virtual TSelf LogP1(TSelf x) => TSelf.Log(x + TSelf.One); 36static virtual TSelf Log2P1(TSelf x) => TSelf.Log2(x + TSelf.One); 46static virtual TSelf Log10P1(TSelf x) => TSelf.Log10(x + TSelf.One);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector.cs (1)
109get => CreateAlternatingSequence(T.One, T.NegativeOne);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.cs (1)
462Debug.Assert(value >= T.Zero && value < T.ScaleB(T.One, significandBitLength));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (1)
1208/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (2)
139/// <summary>Gets a new vector with elements that alternate between <see cref="INumberBase{TSelf}.One" /> and <see cref="ISignedNumber{TSelf}.NegativeOne" />, starting with one.</summary> 145get => CreateAlternatingSequence(T.One, T.NegativeOne);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (1)
138get => CreateAlternatingSequence(T.One, T.NegativeOne);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (1)
138get => CreateAlternatingSequence(T.One, T.NegativeOne);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (1)
111get => CreateAlternatingSequence(T.One, T.NegativeOne);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (1)
623/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (1)
1045/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (1)
1467/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt16.cs (1)
549/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt32.cs (1)
614/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt64.cs (1)
621/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\UIntPtr.cs (1)
616/// <inheritdoc cref="INumberBase{TSelf}.One" />
System.Private.Windows.Core.TestUtilities (13)
XUnit\TestData.cs (13)
43T.One, 46T.MaxValue / (T.One + T.One), 63T.One, 64T.MaxValue / (T.One + T.One) 70T.One, 72T.Zero - T.One, 73T.MaxValue / (T.One + T.One) 82T.Zero, T.MaxValue, T.One, T.MaxValue / (T.One + T.One)
System.Runtime.Numerics (33)
System\Numerics\Complex.cs (1)
529/// <inheritdoc cref="INumberBase{TSelf}.One" />
System\Numerics\Complex.Generic.cs (32)
27public static Complex<T> One => new(T.One, T.Zero); 28public static Complex<T> ImaginaryOne => new(T.Zero, T.One); 33private static readonly T s_inverseOfLog10 = T.One / T.Log(T.CreateChecked(10)); 36private static readonly T s_sqrtRescaleThreshold = T.MaxValue / (T.Sqrt(T.CreateChecked(2)) + T.One); 295T xp1 = T.One + x; 296if (xp1 == T.One) 305return x * T.Log(xp1) / (xp1 - T.One); 425u = T.Atan(T.One / bPrime); 457T D = T.One + cos / cosh; 487b = -T.One; 506T r = T.Hypot(x + T.One, y); 507T s = T.Hypot(x - T.One, y); 514if (x <= T.One) 516T amx = (y * y / (r + (x + T.One)) + (s + (T.One - x))) / T.CreateChecked(2); 524T t = (T.One / (r + (x + T.One)) + T.One / (s + (x - T.One))) / T.CreateChecked(2); 530bPrime = -T.One; 535if (x < T.One) 540T t = (T.One / (r + (x + T.One)) + T.One / (s + (T.One - x))) / T.CreateChecked(2); 542v = Log1P(am1 + y * T.Sqrt(t * (a + T.One))); 546T am1 = (y * y / (r + (x + T.One)) + (s + (x - T.One))) / T.CreateChecked(2); 547v = Log1P(am1 + T.Sqrt(am1 * (a + T.One))); 553v = T.Log(a + T.Sqrt((a - T.One) * (a + T.One))); 1629static Complex<T> ISignedNumber<Complex<T>>.NegativeOne => new(-T.One, T.Zero);
System.Threading.Tasks.Parallel (1)
System\Threading\Tasks\Parallel.ForEachAsync.cs (1)
119if (Interlocked.CompareExchange(ref state.NextAvailable, element + T.One, element) != element)