Skip to content

Commit 725a8a6

Browse files
committed
Minor optimizations using Ten not 10
1 parent c6874e0 commit 725a8a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

BigReal/BigReal.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,14 +560,14 @@ public static BigReal Round(BigReal value) {
560560
/// Note: Pass <see cref="MidpointRounding.ToEven"/> to use banker's rounding (the default for <see cref="Math.Round(double)"/>).
561561
/// </remarks>
562562
public static BigReal Round(BigReal value, int decimals) {
563-
BigReal exponent = Pow(10, decimals);
563+
BigReal exponent = Pow(Ten, decimals);
564564
return Round(value * exponent, MidpointRounding.AwayFromZero) / exponent;
565565
}
566566
/// <summary>
567567
/// Returns the closest value with <paramref name="decimals"/> decimal places to <paramref name="value"/> according to the rounding <paramref name="mode"/>.
568568
/// </summary>
569569
public static BigReal Round(BigReal value, int decimals, MidpointRounding mode) {
570-
BigReal exponent = Pow(10, decimals);
570+
BigReal exponent = Pow(Ten, decimals);
571571
return Round(value * exponent, mode) / exponent;
572572
}
573573
/// <summary>
@@ -632,7 +632,7 @@ public static BigReal Truncate(BigReal value) {
632632
/// Returns <paramref name="value"/> with the digits after <paramref name="decimals"/> decimal places zeroed.
633633
/// </summary>
634634
public static BigReal Truncate(BigReal value, int decimals) {
635-
BigReal exponent = Pow(10, decimals);
635+
BigReal exponent = Pow(Ten, decimals);
636636
return Truncate(value * exponent) / exponent;
637637
}
638638
/// <summary>

0 commit comments

Comments
 (0)