CKTIS / C#
System.OverflowException: practical reference
System.OverflowException: practical reference: OverflowException reports a numeric result outside the target type range in a checked context or conversion.
Version: .NET API; verified against .NET 10 reference surface
Syntax
System.OverflowException /* select a documented member or constructor */OverflowException reports a numeric result outside the target type range in a checked context or conversion.
Use checked at boundaries where numeric wraparound would corrupt data.
Not every arithmetic operation throws; unchecked integer operations wrap around.
Negating MinValue or calling Abs(MinValue) can also overflow a signed type.
The complete program actually uses System.OverflowException; its exact expected stdout is OverflowException.
Examples
using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
using Number = System.Int32;
try { checked { var value = int.MaxValue; value++; } } catch (OverflowException error) { Console.WriteLine(error.GetType().Name); }
Result
OverflowException
The complete program actually uses `System.OverflowException`; its exact expected stdout is `OverflowException`.