Skip to content

Commit fda98a4

Browse files
authored
Clarify example (dotnet#35499)
1 parent c879b90 commit fda98a4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/csharp/language-reference/operators/arithmetic-operators.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ Because of [numeric promotions](~/_csharpstandard/standard/expressions.md#1247-n
186186

187187
:::code language="csharp" interactive="try-dotnet-method" source="snippets/shared/ArithmeticOperators.cs" id="CompoundAssignmentWithCast":::
188188

189+
In the preceding example, value `44` is the result of converting value `300` to the `byte` type.
190+
191+
> [!NOTE]
192+
> In the [checked overflow-checking context](../statements/checked-and-unchecked.md), the preceding example throws an <xref:System.OverflowException>. For more information, see the [Integer arithmetic overflow](#integer-arithmetic-overflow) section.
193+
189194
You also use the `+=` and `-=` operators to subscribe to and unsubscribe from an [event](../keywords/event.md), respectively. For more information, see [How to subscribe to and unsubscribe from events](../../programming-guide/events/how-to-subscribe-to-and-unsubscribe-from-events.md).
190195

191196
## Operator precedence and associativity

0 commit comments

Comments
 (0)