Skip to content

Commit 1d7877a

Browse files
committed
fix bookmark links
1 parent ceebeec commit 1d7877a

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

xml/System/Math.xml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6664,15 +6664,12 @@ The following example illustrates the problem. It repeatedly adds .1 to 11.0 and
66646664
Problems of precision in rounding midpoint values are most likely to arise in the following conditions:
66656665

66666666
- When a fractional value cannot be expressed precisely in the floating-point type's binary format.
6667-
66686667
- When the value to be rounded is calculated from one or more floating-point operations.
6669-
66706668
- When the value to be rounded is a <xref:System.Single> rather than a <xref:System.Double> or <xref:System.Decimal>. For more information, see the next section, [Rounding and single-precision floating-point values](#rounding-and-single-precision-floating-point-values).
66716669

6672-
In cases where the lack of precision in rounding operations is problematic, you can do the following:
6670+
In cases where the lack of precision in rounding operations is problematic, you can do the following:
66736671

66746672
- If the rounding operation calls an overload that rounds a <xref:System.Double> value, you can change the <xref:System.Double> to a <xref:System.Decimal> value and call an overload that rounds a <xref:System.Decimal> value instead. Although the <xref:System.Decimal> data type also has problems of representation and loss of precision, these issues are far less common.
6675-
66766673
- Define a custom rounding algorithm that performs a "nearly equal" test to determine whether the value to be rounded is acceptably close to a midpoint value. The following example defines a `RoundApproximate` method that examines whether a fractional value is sufficiently near to a midpoint value to be subject to midpoint rounding. As the output from the example shows, it corrects the rounding problem shown in the previous example.
66776674

66786675
:::code language="csharp" source="~/snippets/csharp/System/Decimal/Round/precision2.cs" id="Snippet8":::
@@ -6693,16 +6690,7 @@ In many cases, as the example illustrates, the loss of precision can be minimize
66936690

66946691
## Examples
66956692

6696-
In addition to the examples in the [Remarks](#remarks-round) section, this article includes examples that illustrate the following overloads of the `Math.Round` method:
6697-
6698-
[Math.Round(Decimal)](#Round1_Example)
6699-
[Math.Round(Double)](#Round2_Example)
6700-
[Math.Round(Decimal, Int32)](#Round3_Example)
6701-
[Math.Round(Decimal, MidpointRounding)](#Round4_Example)
6702-
[Math.Round(Double, Int32)](#Round5_Example)
6703-
[Math.Round(Double, MidpointRounding)](#Round6_Example)
6704-
[Math.Round(Decimal, Int32, MidpointRounding)](#Round7_Example)
6705-
[Math.Round(Double, Int32, MidpointRounding)](#Round8_Example)
6693+
In addition to the examples in the [Remarks](#remarks) section, there are examples in each overload of the `Math.Round` method.
67066694

67076695
]]></format>
67086696
</remarks>

0 commit comments

Comments
 (0)