Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update Byte.xml
  • Loading branch information
albert-du committed Dec 28, 2021
commit d03aa5a5987b847d11a809c8374d028b065f8195
2 changes: 1 addition & 1 deletion xml/System/Byte.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
- You can declare a <xref:System.Byte> variable and assign it a literal integer value that is within the range of the <xref:System.Byte> data type. The following example declares two <xref:System.Byte> variables and assigns them values in this way.

:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.byte.instantiation/cs/byteinstantiation1.cs" id="Snippet1":::
:::code language="fsharp" source="~/samples/snippets/fsharp/VS_Snippets_CLR_System/system.byte.instantiation/cfs/byteinstantiation1.fs" id="Snippet1":::
:::code language="fsharp" source="~/samples/snippets/fsharp/VS_Snippets_CLR_System/system.byte.instantiation/fs/byteinstantiation1.fs" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.byte.instantiation/vb/byteinstantiate1.vb" id="Snippet1":::

- You can assign a non-byte numeric value to a byte. This is a narrowing conversion, so it requires a cast operator in C# and F#, or a conversion method in Visual Basic if `Option Strict` is on. If the non-byte value is a <xref:System.Single>, <xref:System.Double>, or <xref:System.Decimal> value that includes a fractional component, the handling of its fractional part depends on the compiler performing the conversion. The following example assigns several numeric values to <xref:System.Byte> variables.
Expand Down