You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: xml/System.IO/WindowsRuntimeStreamExtensions.xml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,7 @@ Here's the XAML code that is associated with the previous example.
89
89
## Remarks
90
90
91
91
> [!NOTE]
92
-
> In Visual Basic and C#, you can call this method as an instance method on any object of type <System.IO.Stream>. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](~/docs/visual-basic/programming-guide/language-features/procedures/extension-methods.md) or [Extension Methods (C# Programming Guide)](~/docs/csharp/programming-guide/classes-and-structs/extension-methods.md).
92
+
> In Visual Basic and C#, you can call this method as an instance method on any object of type <xref:System.IO.Stream>. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](~/docs/visual-basic/programming-guide/language-features/procedures/extension-methods.md) or [Extension Methods (C# Programming Guide)](~/docs/csharp/programming-guide/classes-and-structs/extension-methods.md).
93
93
94
94
## Examples
95
95
@@ -435,7 +435,7 @@ In most situations, buffering improves the performance of stream operations. You
435
435
> [!NOTE]
436
436
> In Visual Basic and C#, you can call this method as an instance method on any object of type <xref:System.IO.Stream>. When you use instance method syntax to call this method, omit the first parameter. For more information, see [Extension Methods (Visual Basic)](~/docs/visual-basic/programming-guide/language-features/procedures/extension-methods.md) or [Extension Methods (C# Programming Guide)](~/docs/csharp/programming-guide/classes-and-structs/extension-methods.md).
437
437
438
-
A default buffer size of 16,384 bytes is used when converting the stream. To specify a different buffer size, use the <xref:> overload.
438
+
A default buffer size of 16,384 bytes is used when converting the stream. To specify a different buffer size, use the <xref:System.IO.WindowsRuntimeStreamExtensions.AsStreamForWrite(Windows.Storage.Streams.IOutputStream,System.Int32)> overload.
439
439
440
440
## Examples
441
441
The following example shows how to use the <xref:System.IO.WindowsRuntimeStreamExtensions.AsStreamForWrite%2A> and <xref:System.IO.WindowsRuntimeStreamExtensions.AsStreamForRead%2A> methods to convert a managed stream to and from a stream in the Windows Runtime.
Copy file name to clipboardExpand all lines: xml/System.Text.Json/Utf8JsonWriter.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ To be able to format the output with indentation and white space OR to skip vali
58
58
<Docs>
59
59
<paramname="bufferWriter">The destination for writing JSON text.</param>
60
60
<paramname="options">Defines the customized behavior of the <seecref="T:System.Text.Json.Utf8JsonWriter" /> By default, it writes minimized JSON (with no extra whitespace) and validates that the JSON being written is structurally valid according to the JSON RFC.</param>
61
-
<summary>Constructs a new <seecref="T:System.Text.Json.Utf8JsonWriter" /> instance with a specified <seecref="T:System.Buffers.IBufferWriter<System.Byte>" />.</summary>
61
+
<summary>Constructs a new <seecref="T:System.Text.Json.Utf8JsonWriter" /> instance with a specified <seelangword="System.Buffers.IBufferWriter<System.Byte>" />.</summary>
62
62
<remarks>To be added.</remarks>
63
63
<exceptioncref="T:System.ArgumentNullException"><paramrefname="bufferWriter" /> is <seelangword="null" />.</exception>
- [Midpoint values and rounding conventions](#midpoint-values-and-rounding-conventions)
4501
4501
- [Rounding and precision](#rounding-and-precision)
4502
4502
- [Rounding and single-precision floating point values](#rounding-and-single-precision-floating-point-values)
4503
-
- [Examples of individual overloads](#examples)
4503
+
- [Examples of individual overloads](#round-examples)
4504
4504
4505
4505
### Which method do I call?
4506
4506
@@ -4513,7 +4513,7 @@ You can use the following table to select an appropriate rounding method. In add
4513
4513
|Round a number to a specified number of fractional digits by using the rounding to nearest convention.|<xref:System.Math.Round%28System.Decimal%2CSystem.Int32%29><br /><br /> -or-<br /><br /> <xref:System.Math.Round%28System.Double%2CSystem.Int32%29>|
4514
4514
|Round a number to a specified number of fractional digits by using a specified rounding convention.|<xref:System.Math.Round%28System.Decimal%2CSystem.Int32%2CSystem.MidpointRounding%29><br /><br /> -or-<br /><br /> <xref:System.Math.Round%28System.Double%2CSystem.Int32%2CSystem.MidpointRounding%29>|
4515
4515
|Round a <xref:System.Single> value to a specified number of fractional digits by using a specified rounding convention and minimizing the loss of precision.|Convert the <xref:System.Single> to a <xref:System.Decimal> and call <xref:System.Math.Round%28System.Decimal%2CSystem.Int32%2CSystem.MidpointRounding%29>.|
4516
-
|Round a number to a specified number of fractional digits while minimizing problems of precision in rounding midpoint values.|Call a rounding method that implements a "greater than or approximately equal to" comparison. See [Rounding and precision](#Precision).|
4516
+
|Round a number to a specified number of fractional digits while minimizing problems of precision in rounding midpoint values.|Call a rounding method that implements a "greater than or approximately equal to" comparison. See [Rounding and precision](#precision).|
4517
4517
|Round a fractional value to an integer that is greater than the fractional value. For example, round 3.1 to 4.|<xref:System.Math.Ceiling%2A>|
4518
4518
|Round a fractional value to an integer that is less than the fractional value. For example, round 3.9 to 3.|<xref:System.Math.Floor%2A>|
4519
4519
@@ -4555,6 +4555,7 @@ By default, the <xref:System.Math.Round%2A> method uses the rounding to nearest
4555
4555
|<xref:System.Math.Round%28System.Decimal%2CSystem.Int32%2CSystem.MidpointRounding%29>|Determined by `mode` parameter|
4556
4556
|<xref:System.Math.Round%28System.Double%2CSystem.Int32%2CSystem.MidpointRounding%29>|Determined by `mode` parameter|
4557
4557
4558
+
<a name="precision"></a>
4558
4559
### Rounding and precision
4559
4560
4560
4561
In order to determine whether a rounding operation involves a midpoint value, the <xref:System.Math.Round%2A> method multiplies the original value to be rounded by 10<sup>n</sup>, where *n* is the desired number of fractional digits in the return value, and then determines whether the remaining fractional portion of the value is greater than or equal to .5. This is a slight variation on a test for equality, and as discussed in the "Testing for Equality" section of the <xref:System.Double> reference topic, tests for equality with floating-point values are problematic because of the floating-point format's issues with binary representation and precision. This means that any fractional portion of a number that is slightly less than .5 (because of a loss of precision) will not be rounded upward.
@@ -4572,7 +4573,7 @@ Problems of precision in rounding midpoint values are most likely to arise in th
4572
4573
4573
4574
- When the value to be rounded is calculated from one or more floating-point operations.
4574
4575
4575
-
- 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](#Single).
4576
+
- 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).
4576
4577
4577
4578
In cases where the lack of precision in rounding operations is problematic, you can do the following:
4578
4579
@@ -4593,7 +4594,8 @@ The <xref:System.Math.Round%2A> method includes overloads that accept arguments
4593
4594
This unexpected result is due to a loss of precision in the conversion of the <xref:System.Single> value to a <xref:System.Double>. Because the resulting <xref:System.Double> value of 16.325000762939453 is not a midpoint value and is greater than 16.325, it is always rounded upward.
4594
4595
4595
4596
In many cases, as the example illustrates, the loss of precision can be minimized or eliminated by casting or converting the <xref:System.Single> value to a <xref:System.Decimal>. Note that, because this is a narrowing conversion, it requires using a cast operator or calling a conversion method.
4596
-
4597
+
4598
+
<a name="round-examples"></a>
4597
4599
## Examples
4598
4600
4599
4601
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:
0 commit comments