1157 {
1158 if (digits < 0 || digits > 15)
1159 {
1160 throw new ArgumentOutOfRangeException("digits", SR.ArgumentOutOfRange_RoundingDigits);
1161 }
1162 if (mode < MidpointRounding.ToEven || mode >
MidpointRounding.ToPositiveInfinity)
1163 {
1164 throw new ArgumentException(SR.Format(SR.Argument_InvalidEnumValue, mode,
"MidpointRounding"),
"mode");
1165 }
1166 if (
Abs(
value) < 10000000000000000.0)
1167 {
1170 switch (mode)
1171 {
1174 break;
1176 {
1178 if (
Abs(value2) >= 0.5)
1179 {
1181 }
1182 break;
1183 }
1186 break;
1189 break;
1192 break;
1193 default:
1194 throw new ArgumentException(SR.Format(SR.Argument_InvalidEnumValue, mode,
"MidpointRounding"),
"mode");
1195 }
1197 }
1199 }
static decimal Truncate(decimal d)
static decimal Round(decimal d)
static double Ceiling(double a)
static readonly double[] roundPower10Double
static double Abs(double value)
static double Floor(double d)
static int Sign(decimal value)
static unsafe double ModF(double x, double *intptr)