207 references to MidpointRounding
aspire (2)
src\Shared\ConsoleLogs\SharedAIHelpers.cs (1)
394return (int)Math.Round(durationNano / 1_000_000.0, 0, MidpointRounding.AwayFromZero);
src\Shared\DurationFormatter.cs (1)
65var secondaryValue = Math.Round((ticks / secondaryUnit.Ticks) % ofPrevious, MidpointRounding.AwayFromZero);
Aspire.Dashboard (2)
src\Shared\ConsoleLogs\SharedAIHelpers.cs (1)
394return (int)Math.Round(durationNano / 1_000_000.0, 0, MidpointRounding.AwayFromZero);
src\Shared\DurationFormatter.cs (1)
65var secondaryValue = Math.Round((ticks / secondaryUnit.Ticks) % ofPrevious, MidpointRounding.AwayFromZero);
Microsoft.Build (2)
Evaluation\Profiler\EvaluationLocationPrettyPrinterBase.cs (2)
36return Math.Round(timeSpan.TotalMilliseconds, 0, MidpointRounding.AwayFromZero); 44return Math.Round(percentage, 1, MidpointRounding.AwayFromZero);
Microsoft.TestPlatform.CrossPlatEngine (2)
TestEngine.cs (2)
398< 8 => (int)Math.Round(parallelLevelToUse / 2.0, MidpointRounding.AwayFromZero), 399_ => (int)Math.Round(0.75 * parallelLevelToUse, MidpointRounding.AwayFromZero),
mscorlib (1)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
363[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.MidpointRounding))]
netstandard (1)
netstandard.cs (1)
1055[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.MidpointRounding))]
PresentationCore (3)
MS\Internal\TextFormatting\TextFormatterImp.cs (3)
643return RoundDipForDisplayMode(value, pixelsPerDip, MidpointRounding.ToEven); 646private static double RoundDipForDisplayMode(double value, double pixelsPerDip, MidpointRounding midpointRounding) 666return RoundDipForDisplayMode(value, pixelsPerDip, MidpointRounding.AwayFromZero);
System.Numerics.Tensors (29)
System\Numerics\Tensors\netcore\Tensor.cs (12)
4778public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, int digits, MidpointRounding mode) 4782TensorOperation.Invoke<TensorOperation.Round<T>, T, Tuple<int, MidpointRounding>, T>(x, Tuple.Create(digits, mode), destination); 4791public static ref readonly TensorSpan<T> Round<T>(scoped in ReadOnlyTensorSpan<T> x, int digits, MidpointRounding mode, in TensorSpan<T> destination) 4795TensorOperation.Invoke<TensorOperation.Round<T>, T, Tuple<int, MidpointRounding>, T>(x, Tuple.Create(digits, mode), in destination); 4806TensorOperation.Invoke<TensorOperation.Round<T>, T, Tuple<int, MidpointRounding>, T>(x, Tuple.Create(digits, MidpointRounding.ToEven), destination); 4818TensorOperation.Invoke<TensorOperation.Round<T>, T, Tuple<int, MidpointRounding>, T>(x, Tuple.Create(digits, MidpointRounding.ToEven), in destination); 4825public static Tensor<T> Round<T>(in ReadOnlyTensorSpan<T> x, MidpointRounding mode) 4829TensorOperation.Invoke<TensorOperation.Round<T>, T, Tuple<int, MidpointRounding>, T>(x, Tuple.Create(0, mode), destination); 4837public static ref readonly TensorSpan<T> Round<T>(scoped in ReadOnlyTensorSpan<T> x, MidpointRounding mode, in TensorSpan<T> destination) 4841TensorOperation.Invoke<TensorOperation.Round<T>, T, Tuple<int, MidpointRounding>, T>(x, Tuple.Create(0, mode), in destination);
System\Numerics\Tensors\netcore\TensorOperation.cs (3)
1862IBinaryOperation_Tensor_Scalar<T, Tuple<int, MidpointRounding>, T> 1875public static void Invoke(ref readonly T x, Tuple<int, MidpointRounding> y, ref T destination) 1880public static void Invoke(ReadOnlySpan<T> x, Tuple<int, MidpointRounding> y, Span<T> destination)
System\Numerics\Tensors\netcore\TensorPrimitives.Round.cs (14)
44public static void Round<T>(ReadOnlySpan<T> x, MidpointRounding mode, Span<T> destination) 49case MidpointRounding.ToEven: 53case MidpointRounding.AwayFromZero: 62case MidpointRounding.ToZero: 66case MidpointRounding.ToNegativeInfinity: 70case MidpointRounding.ToPositiveInfinity: 75throw new ArgumentException(SR.Format(SR.Argument_InvalidEnumValue, mode, typeof(MidpointRounding)), nameof(mode)); 91Round(x, digits, MidpointRounding.ToEven, destination); 107public static void Round<T>(ReadOnlySpan<T> x, int digits, MidpointRounding mode, Span<T> destination) 121if ((uint)mode > (uint)MidpointRounding.ToPositiveInfinity) 123throw new ArgumentException(SR.Format(SR.Argument_InvalidEnumValue, mode, typeof(MidpointRounding)), nameof(mode)); 191public static T Invoke(T x) => T.Round(x, MidpointRounding.AwayFromZero); 244private readonly struct RoundFallbackOperator<T>(int digits, MidpointRounding mode) : IStatefulUnaryOperator<T> 248private readonly MidpointRounding _mode = mode;
System.Private.CoreLib (160)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (10)
401DecCalc.InternalRound(ref AsMutable(ref d), (byte)(flags >> ScaleShift), MidpointRounding.ToPositiveInfinity); 473DecCalc.InternalRound(ref AsMutable(ref d), (byte)(flags >> ScaleShift), MidpointRounding.ToNegativeInfinity); 673public static decimal Round(decimal d) => Round(ref d, 0, MidpointRounding.ToEven); 674public static decimal Round(decimal d, int decimals) => Round(ref d, decimals, MidpointRounding.ToEven); 675public static decimal Round(decimal d, MidpointRounding mode) => Round(ref d, 0, mode); 676public static decimal Round(decimal d, int decimals, MidpointRounding mode) => Round(ref d, decimals, mode); 678private static decimal Round(ref decimal d, int decimals, MidpointRounding mode) 682if ((uint)mode > (uint)MidpointRounding.ToPositiveInfinity) 683throw new ArgumentException(SR.Format(SR.Argument_InvalidEnumValue, mode, nameof(MidpointRounding)), nameof(mode)); 892DecCalc.InternalRound(ref AsMutable(ref d), (byte)(flags >> ScaleShift), MidpointRounding.ToZero);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.DecCalc.cs (8)
1306InternalRound(ref pdecIn, (uint)scale, MidpointRounding.ToEven); 2391internal static void InternalRound(ref DecCalc d, uint scale, MidpointRounding mode) 2443if (mode <= MidpointRounding.ToZero) 2472if (mode == MidpointRounding.ToZero) 2474else if (mode == MidpointRounding.ToEven) 2483else if (mode == MidpointRounding.AwayFromZero) 2490else if (mode == MidpointRounding.ToNegativeInfinity) 2498Debug.Assert(mode == MidpointRounding.ToPositiveInfinity);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (4)
686/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, MidpointRounding)" /> 687public static double Round(double x, MidpointRounding mode) => Math.Round(x, mode); 689/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, int, MidpointRounding)" /> 690public static double Round(double x, int digits, MidpointRounding mode) => Math.Round(x, digits, mode);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (4)
1367/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, MidpointRounding)" /> 1368public static Half Round(Half x, MidpointRounding mode) => (Half)MathF.Round((float)x, mode); 1370/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, int, MidpointRounding)" /> 1371public static Half Round(Half x, int digits, MidpointRounding mode) => (Half)MathF.Round((float)x, digits, mode);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Math.cs (11)
1307public static decimal Round(decimal d, MidpointRounding mode) 1313public static decimal Round(decimal d, int decimals, MidpointRounding mode) 1365return Round(value, digits, MidpointRounding.ToEven); 1369public static double Round(double value, MidpointRounding mode) 1375case MidpointRounding.AwayFromZero: 1385case MidpointRounding.ToEven: 1388case MidpointRounding.ToZero: 1391case MidpointRounding.ToNegativeInfinity: 1394case MidpointRounding.ToPositiveInfinity: 1404public static double Round(double value, int digits, MidpointRounding mode) 1411if ((uint)mode > (uint)MidpointRounding.ToPositiveInfinity)
src\runtime\src\libraries\System.Private.CoreLib\src\System\MathF.cs (9)
389return Round(x, digits, MidpointRounding.ToEven); 393public static float Round(float x, MidpointRounding mode) 399case MidpointRounding.AwayFromZero: 409case MidpointRounding.ToEven: 412case MidpointRounding.ToZero: 415case MidpointRounding.ToNegativeInfinity: 418case MidpointRounding.ToPositiveInfinity: 428public static float Round(float x, int digits, MidpointRounding mode) 435if ((uint)mode > (uint)MidpointRounding.ToPositiveInfinity)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.DecimalIeee754.cs (7)
1928internal static TValue RoundDecimalIeee754<TDecimal, TValue>(TValue bits, int digits, MidpointRounding mode) 1937if ((uint)mode > (uint)MidpointRounding.ToPositiveInfinity) 2005MidpointRounding.ToEven => (discardedComparedToHalf > 0) || ((discardedComparedToHalf == 0) && !TValue.IsZero(quotient & TValue.One)), 2006MidpointRounding.AwayFromZero => discardedComparedToHalf >= 0, 2007MidpointRounding.ToZero => false, 2008MidpointRounding.ToNegativeInfinity => discardedNonZero && a.Signed, 2009MidpointRounding.ToPositiveInfinity => discardedNonZero && !a.Signed,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Rounding.cs (22)
21public static bool TryRoundToDecimalDigitsFast(double value, int digits, MidpointRounding mode, out double result) 25Debug.Assert((uint)mode <= (uint)MidpointRounding.ToPositiveInfinity); 32/// <inheritdoc cref="TryRoundToDecimalDigitsFast(double, int, MidpointRounding, out double)" /> 33public static bool TryRoundToDecimalDigitsFast(float value, int digits, MidpointRounding mode, out float result) 37Debug.Assert((uint)mode <= (uint)MidpointRounding.ToPositiveInfinity); 50private static bool TryRoundToDecimalDigitsViaFusedMultiplyAdd<TNumber>(TNumber value, int digits, MidpointRounding mode, out TNumber result) 79TNumber rn = TNumber.Round(hi, MidpointRounding.ToEven); 123private static bool TryRoundToDecimalDigitsViaInteger(double value, int digits, MidpointRounding mode, out double result) 164/// <inheritdoc cref="TryRoundToDecimalDigitsViaInteger(double, int, MidpointRounding, out double)" /> 165private static bool TryRoundToDecimalDigitsViaInteger(float value, int digits, MidpointRounding mode, out float result) 254private static bool ShouldRoundUp(MidpointRounding mode, int midpointComparison, bool isFloorOdd, bool hasRemainder, bool isNegative) 258MidpointRounding.ToEven => (midpointComparison > 0) || ((midpointComparison == 0) && isFloorOdd), 259MidpointRounding.AwayFromZero => midpointComparison >= 0, 260MidpointRounding.ToZero => false, 261MidpointRounding.ToNegativeInfinity => isNegative && hasRemainder, 262MidpointRounding.ToPositiveInfinity => !isNegative && hasRemainder, 296public static unsafe TNumber RoundToDecimalDigits<TNumber>(TNumber value, int digits, MidpointRounding mode) 352case MidpointRounding.ToEven: 358case MidpointRounding.AwayFromZero: 363case MidpointRounding.ToZero: 368case MidpointRounding.ToNegativeInfinity: 373case MidpointRounding.ToPositiveInfinity:
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BFloat16.cs (4)
985/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, MidpointRounding)" /> 986public static BFloat16 Round(BFloat16 x, MidpointRounding mode) => (BFloat16)float.Round((float)x, mode); 988/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, int, MidpointRounding)" /> 989public static BFloat16 Round(BFloat16 x, int digits, MidpointRounding mode) => (BFloat16)float.Round((float)x, digits, mode);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal128.cs (9)
817public static Decimal128 Ceiling(Decimal128 x) => new Decimal128(Number.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), 0, MidpointRounding.ToPositiveInfinity)); 828public static Decimal128 Floor(Decimal128 x) => new Decimal128(Number.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), 0, MidpointRounding.ToNegativeInfinity)); 831public static Decimal128 Round(Decimal128 x) => new Decimal128(Number.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), 0, MidpointRounding.ToEven)); 834public static Decimal128 Round(Decimal128 x, int digits) => new Decimal128(Number.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), digits, MidpointRounding.ToEven)); 836/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, MidpointRounding)" /> 837public static Decimal128 Round(Decimal128 x, MidpointRounding mode) => new Decimal128(Number.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), 0, mode)); 839/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, int, MidpointRounding)" /> 840public static Decimal128 Round(Decimal128 x, int digits, MidpointRounding mode) => new Decimal128(Number.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), digits, mode)); 843public static Decimal128 Truncate(Decimal128 x) => new Decimal128(Number.RoundDecimalIeee754<Decimal128, UInt128>(new UInt128(x._upper, x._lower), 0, MidpointRounding.ToZero));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal32.cs (9)
828public static Decimal32 Ceiling(Decimal32 x) => new Decimal32(Number.RoundDecimalIeee754<Decimal32, uint>(x._value, 0, MidpointRounding.ToPositiveInfinity)); 839public static Decimal32 Floor(Decimal32 x) => new Decimal32(Number.RoundDecimalIeee754<Decimal32, uint>(x._value, 0, MidpointRounding.ToNegativeInfinity)); 842public static Decimal32 Round(Decimal32 x) => new Decimal32(Number.RoundDecimalIeee754<Decimal32, uint>(x._value, 0, MidpointRounding.ToEven)); 845public static Decimal32 Round(Decimal32 x, int digits) => new Decimal32(Number.RoundDecimalIeee754<Decimal32, uint>(x._value, digits, MidpointRounding.ToEven)); 847/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, MidpointRounding)" /> 848public static Decimal32 Round(Decimal32 x, MidpointRounding mode) => new Decimal32(Number.RoundDecimalIeee754<Decimal32, uint>(x._value, 0, mode)); 850/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, int, MidpointRounding)" /> 851public static Decimal32 Round(Decimal32 x, int digits, MidpointRounding mode) => new Decimal32(Number.RoundDecimalIeee754<Decimal32, uint>(x._value, digits, mode)); 854public static Decimal32 Truncate(Decimal32 x) => new Decimal32(Number.RoundDecimalIeee754<Decimal32, uint>(x._value, 0, MidpointRounding.ToZero));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Decimal64.cs (9)
821public static Decimal64 Ceiling(Decimal64 x) => new Decimal64(Number.RoundDecimalIeee754<Decimal64, ulong>(x._value, 0, MidpointRounding.ToPositiveInfinity)); 832public static Decimal64 Floor(Decimal64 x) => new Decimal64(Number.RoundDecimalIeee754<Decimal64, ulong>(x._value, 0, MidpointRounding.ToNegativeInfinity)); 835public static Decimal64 Round(Decimal64 x) => new Decimal64(Number.RoundDecimalIeee754<Decimal64, ulong>(x._value, 0, MidpointRounding.ToEven)); 838public static Decimal64 Round(Decimal64 x, int digits) => new Decimal64(Number.RoundDecimalIeee754<Decimal64, ulong>(x._value, digits, MidpointRounding.ToEven)); 840/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, MidpointRounding)" /> 841public static Decimal64 Round(Decimal64 x, MidpointRounding mode) => new Decimal64(Number.RoundDecimalIeee754<Decimal64, ulong>(x._value, 0, mode)); 843/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, int, MidpointRounding)" /> 844public static Decimal64 Round(Decimal64 x, int digits, MidpointRounding mode) => new Decimal64(Number.RoundDecimalIeee754<Decimal64, ulong>(x._value, digits, mode)); 847public static Decimal64 Truncate(Decimal64 x) => new Decimal64(Number.RoundDecimalIeee754<Decimal64, ulong>(x._value, 0, MidpointRounding.ToZero));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\IFloatingPoint.cs (9)
17static virtual TSelf Ceiling(TSelf x) => TSelf.Round(x, digits: 0, MidpointRounding.ToPositiveInfinity); 42static virtual TSelf Floor(TSelf x) => TSelf.Round(x, digits: 0, MidpointRounding.ToNegativeInfinity); 44/// <summary>Rounds a value to the nearest integer using the default rounding mode (<see cref="MidpointRounding.ToEven" />).</summary> 47static virtual TSelf Round(TSelf x) => TSelf.Round(x, digits: 0, MidpointRounding.ToEven); 49/// <summary>Rounds a value to a specified number of fractional-digits using the default rounding mode (<see cref="MidpointRounding.ToEven" />).</summary> 53static virtual TSelf Round(TSelf x, int digits) => TSelf.Round(x, digits, MidpointRounding.ToEven); 59static virtual TSelf Round(TSelf x, MidpointRounding mode) => TSelf.Round(x, digits: 0, mode); 66static abstract TSelf Round(TSelf x, int digits, MidpointRounding mode); 71static virtual TSelf Truncate(TSelf x) => TSelf.Round(x, digits: 0, MidpointRounding.ToZero);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector.cs (4)
2903/// <inheritdoc cref="Vector128.Round(Vector128{double}, MidpointRounding)" /> 2905public static Vector<double> Round(Vector<double> vector, MidpointRounding mode) => VectorMath.RoundDouble(vector, mode); 2907/// <inheritdoc cref="Vector128.Round(Vector128{float}, MidpointRounding)" /> 2909public static Vector<float> Round(Vector<float> vector, MidpointRounding mode) => VectorMath.RoundSingle(vector, mode);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector2.cs (2)
881/// <inheritdoc cref="Vector4.Round(Vector4, MidpointRounding)" /> 884public static Vector2 Round(Vector2 vector, MidpointRounding mode) => Vector128.Round(vector.AsVector128Unsafe(), mode).AsVector2();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector3.cs (2)
918/// <inheritdoc cref="Vector4.Round(Vector4, MidpointRounding)" /> 921public static Vector3 Round(Vector3 vector, MidpointRounding mode) => Vector128.Round(vector.AsVector128Unsafe(), mode).AsVector3();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector4.cs (2)
967/// <inheritdoc cref="Vector128.Round(Vector128{float}, MidpointRounding)" /> 970public static Vector4 Round(Vector4 vector, MidpointRounding mode) => Vector128.Round(vector.AsVector128(), mode).AsVector4();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NFloat.cs (4)
999/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, MidpointRounding)" /> 1000public static NFloat Round(NFloat x, MidpointRounding mode) => new NFloat(NativeType.Round(x._value, mode)); 1002/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, int, MidpointRounding)" /> 1003public static NFloat Round(NFloat x, int digits, MidpointRounding mode) => new NFloat(NativeType.Round(x._value, digits, mode));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\ISimdVector_2.cs (1)
688/// <summary>Rounds each element in a vector to the nearest integer using the default rounding mode (<see cref="MidpointRounding.ToEven" />).</summary>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (4)
3182/// <inheritdoc cref="Vector64.Round(Vector64{double}, MidpointRounding)" /> 3184public static Vector128<double> Round(Vector128<double> vector, MidpointRounding mode) => VectorMath.RoundDouble(vector, mode); 3186/// <inheritdoc cref="Vector64.Round(Vector64{float}, MidpointRounding)" /> 3188public static Vector128<float> Round(Vector128<float> vector, MidpointRounding mode) => VectorMath.RoundSingle(vector, mode);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (4)
3225/// <inheritdoc cref="Vector128.Round(Vector128{double}, MidpointRounding)" /> 3227public static Vector256<double> Round(Vector256<double> vector, MidpointRounding mode) => VectorMath.RoundDouble(vector, mode); 3229/// <inheritdoc cref="Vector128.Round(Vector128{float}, MidpointRounding)" /> 3231public static Vector256<float> Round(Vector256<float> vector, MidpointRounding mode) => VectorMath.RoundSingle(vector, mode);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (4)
3252/// <inheritdoc cref="Vector256.Round(Vector256{double}, MidpointRounding)" /> 3254public static Vector512<double> Round(Vector512<double> vector, MidpointRounding mode) => VectorMath.RoundDouble(vector, mode); 3256/// <inheritdoc cref="Vector256.Round(Vector256{float}, MidpointRounding)" /> 3258public static Vector512<float> Round(Vector512<float> vector, MidpointRounding mode) => VectorMath.RoundSingle(vector, mode);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (2)
3355public static Vector64<double> Round(Vector64<double> vector, MidpointRounding mode) => VectorMath.RoundDouble(vector, mode); 3362public static Vector64<float> Round(Vector64<float> vector, MidpointRounding mode) => VectorMath.RoundSingle(vector, mode);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\VectorMath.cs (12)
1857public static TVectorDouble RoundDouble<TVectorDouble>(TVectorDouble vector, MidpointRounding mode) 1864case MidpointRounding.AwayFromZero: 1872case MidpointRounding.ToEven: 1878case MidpointRounding.ToZero: 1884case MidpointRounding.ToNegativeInfinity: 1890case MidpointRounding.ToPositiveInfinity: 1903public static TVectorSingle RoundSingle<TVectorSingle>(TVectorSingle vector, MidpointRounding mode) 1910case MidpointRounding.AwayFromZero: 1918case MidpointRounding.ToEven: 1924case MidpointRounding.ToZero: 1930case MidpointRounding.ToNegativeInfinity: 1936case MidpointRounding.ToPositiveInfinity:
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (4)
679/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, MidpointRounding)" /> 680public static float Round(float x, MidpointRounding mode) => MathF.Round(x, mode); 682/// <inheritdoc cref="IFloatingPoint{TSelf}.Round(TSelf, int, MidpointRounding)" /> 683public static float Round(float x, int digits, MidpointRounding mode) => MathF.Round(x, digits, mode);
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
357[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.MidpointRounding))]
System.Runtime.Extensions (1)
System.Runtime.Extensions.cs (1)
51[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.MidpointRounding))]
System.Windows.Forms (3)
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (3)
1003dataGridViewColumn.DesiredFillWidth = (int)Math.Round(desiredFillWidth, MidpointRounding.AwayFromZero); 1158mostDeservingDataGridViewColumn.DesiredFillWidth = Math.Min(oldDesiredWidth, (int)Math.Round(floatDesiredWidth, MidpointRounding.AwayFromZero)); 1230mostDeservingDataGridViewColumn.DesiredFillWidth = Math.Max(mostDeservingDataGridViewColumn.MinimumWidth, (int)Math.Round(floatDesiredWidth, MidpointRounding.AwayFromZero));