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)
1270static decimal INumberBase<decimal>.One => One;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (1)
1051static 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)
707static 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)
621static nuint INumberBase<nuint>.One => 1;
System.Runtime.Numerics (1)
System\Numerics\Complex.cs (1)
514static Complex INumberBase<Complex>.One => new(1.0, 0.0);
187 references to One
Microsoft.Diagnostics.DataContractReader.Contracts (2)
Contracts\EcmaMetadata_1.cs (2)
532return 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 (110)
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)
1269/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (1)
1050/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (1)
1797/// <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)
706/// <inheritdoc cref="INumberBase{TSelf}.One" />
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.DecimalIeee754.cs (47)
533TValue payloadMask = (TValue.One << TDecimal.NumberBitsSignificand) - TValue.One; 588TValue payloadMask = (TValue.One << TDecimal.NumberBitsSignificand) - TValue.One; 741return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(coefficient.IsNegative, TValue.One, TDecimal.MinAdjustedExponent); 746? DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(coefficient.IsNegative, TValue.One, TDecimal.MinAdjustedExponent) 823significand += TValue.One; 853TValue payload = nanBits & ((TValue.One << TDecimal.NumberBitsSignificand) - TValue.One); 1027magnitudeHigh += TValue.One; 1042magnitudeHigh -= TValue.One; 1053magnitudeHigh -= TValue.One; 1055magnitudeLow -= TValue.One; 1408resultHigh += TValue.One; 1442resultHigh -= TValue.One; 1445resultLow -= TValue.One; 1817quotientIsOdd = !TValue.IsZero(quotient & TValue.One); 1836quotientIsOdd = !TValue.IsZero(quotient & TValue.One); 2005MidpointRounding.ToEven => (discardedComparedToHalf > 0) || ((discardedComparedToHalf == 0) && !TValue.IsZero(quotient & TValue.One)), 2015quotient += TValue.One; 2128if ((discardedComparedToHalf > 0) || ((discardedComparedToHalf == 0) && !TValue.IsZero(quotient & TValue.One))) 2130quotient += TValue.One; 2234if ((discardedComparedToHalf > 0) || ((discardedComparedToHalf == 0) && !TValue.IsZero(quotient & TValue.One))) 2236quotient += TValue.One; 2268return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: false, TValue.One, a.UnbiasedExponent); 2331return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: false, TValue.One, TDecimal.MinAdjustedExponent); 2342if (a.Signed && (a.Significand == TValue.One) && (exponent == TDecimal.MinAdjustedExponent)) 2362significand += TValue.One; 2373significand -= TValue.One; 2375if ((significand == (TDecimal.Power10(TDecimal.Precision - 1) - TValue.One)) && (exponent != TDecimal.MinAdjustedExponent)) 2411TValue result = TValue.One; 2451TValue lowMask = (TValue.One << half) - TValue.One; 2578high += TValue.One; 2604high -= TValue.One; 2623TValue limit = (TValue.One << ((TValue.Zero.GetByteCount() * 8) / 2)) / ten; 2625divisor = TValue.One; 2644TValue result = TValue.One; 2680TValue lowMask = (TValue.One << half) - TValue.One; 2681TValue baseValue = TValue.One << half; 2768TValue trial = (root << 1) | TValue.One; 2773root += TValue.One; 3004significand += TValue.One; 3021TValue significand = ((leadDigit > 5) || ((leadDigit == 5) && restNonZero)) ? TValue.One : TValue.Zero; 3065return int.CreateTruncating(significand & TValue.One); 3084return int.CreateTruncating(quotient & TValue.One);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.DecimalIeee754.Transcendental.cs (19)
44return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: false, TValue.One, 0); 78return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: false, TValue.One, 0); 112return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: false, TValue.One, 0); 139? DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: true, TValue.One, 0) 175? DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: true, TValue.One, 0) 211? DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: true, TValue.One, 0) 264return significand == TValue.One; 563isOdd = (unbiasedExponent == 0) && !TValue.IsZero(significand & TValue.One); 584isOdd = !TValue.IsZero(quotient & TValue.One); 605return significand == TValue.One ? 0 : 1; 653return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: false, TValue.One, 0); 660return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: false, TValue.One, 0); 703return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: false, TValue.One, 0); 1029return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: false, TValue.One, 0); 1099TValue cosZero = DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: false, TValue.One, 0); 1365return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: false, TValue.One, 0); 1444TValue cosZero = DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: false, TValue.One, 0); 1717return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(signed: false, TValue.One, 0); 1743return DecimalIeee754FiniteNumberBinaryEncoding<TDecimal, TValue>(TDecimal.IsNegative(x), TValue.One, 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Parsing.cs (1)
508overflow |= 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)
1469/// <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)
620/// <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 (42)
System\Numerics\Complex.cs (1)
513/// <inheritdoc cref="INumberBase{TSelf}.One" />
System\Numerics\Complex.Generic.cs (41)
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); 195a = T.CopySign(T.IsInfinity(a) ? T.One : T.Zero, a); 196b = T.CopySign(T.IsInfinity(b) ? T.One : T.Zero, b); 214c = T.CopySign(T.IsInfinity(c) ? T.One : T.Zero, c); 215d = T.CopySign(T.IsInfinity(d) ? T.One : T.Zero, d); 332a = T.CopySign(T.IsInfinity(a) ? T.One : T.Zero, a); 333b = T.CopySign(T.IsInfinity(b) ? T.One : T.Zero, b); 341c = T.CopySign(T.IsInfinity(c) ? T.One : T.Zero, c); 342d = T.CopySign(T.IsInfinity(d) ? T.One : T.Zero, d); 376T xp1 = T.One + x; 377if (xp1 == T.One) 386return x * T.Log(xp1) / (xp1 - T.One); 655u = T.Atan(T.One / bPrime); 752T D = T.One + cos / cosh; 772T re = T.CopySign(T.One, real); 860b = -T.One; 879T r = T.Hypot(x + T.One, y); 880T s = T.Hypot(x - T.One, y); 887if (x <= T.One) 889T amx = (y * y / (r + (x + T.One)) + (s + (T.One - x))) / T.CreateChecked(2); 897T t = (T.One / (r + (x + T.One)) + T.One / (s + (x - T.One))) / T.CreateChecked(2); 903bPrime = -T.One; 908if (x < T.One) 913T t = (T.One / (r + (x + T.One)) + T.One / (s + (T.One - x))) / T.CreateChecked(2); 915v = Log1P(am1 + y * T.Sqrt(t * (a + T.One))); 919T am1 = (y * y / (r + (x + T.One)) + (s + (x - T.One))) / T.CreateChecked(2); 920v = Log1P(am1 + T.Sqrt(am1 * (a + T.One))); 926v = T.Log(a + T.Sqrt((a - T.One) * (a + T.One))); 2065static 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)