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);
678public static decimal Round(decimal d) => Round(ref d, 0, MidpointRounding.ToEven);
679public static decimal Round(decimal d, int decimals) => Round(ref d, decimals, MidpointRounding.ToEven);
680public static decimal Round(decimal d, MidpointRounding mode) => Round(ref d, 0, mode);
681public static decimal Round(decimal d, int decimals, MidpointRounding mode) => Round(ref d, decimals, mode);
683private static decimal Round(ref decimal d, int decimals, MidpointRounding mode)
687if ((uint)mode > (uint)MidpointRounding.ToPositiveInfinity)
688throw new ArgumentException(SR.Format(SR.Argument_InvalidEnumValue, mode, nameof(MidpointRounding)), nameof(mode));
897DecCalc.InternalRound(ref AsMutable(ref d), (byte)(flags >> ScaleShift), MidpointRounding.ToZero);
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);