1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 /*=============================================================================
9 ** Purpose: Exception class for bad arithmetic conditions!
12 =============================================================================*/
14 using System
.Runtime
.Serialization
;
18 // The ArithmeticException is thrown when overflow or underflow
21 [System
.Runtime
.CompilerServices
.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
22 public class ArithmeticException
: SystemException
24 // Creates a new ArithmeticException with its message string set to
25 // the empty string, its HRESULT set to COR_E_ARITHMETIC,
26 // and its ExceptionInfo reference set to null.
27 public ArithmeticException()
28 : base(SR
.Arg_ArithmeticException
)
30 HResult
= HResults
.COR_E_ARITHMETIC
;
33 // Creates a new ArithmeticException with its message string set to
34 // message, its HRESULT set to COR_E_ARITHMETIC,
35 // and its ExceptionInfo reference set to null.
37 public ArithmeticException(string? message
)
40 HResult
= HResults
.COR_E_ARITHMETIC
;
43 public ArithmeticException(string? message
, Exception
? innerException
)
44 : base(message
, innerException
)
46 HResult
= HResults
.COR_E_ARITHMETIC
;
49 protected ArithmeticException(SerializationInfo info
, StreamingContext context
) : base(info
, context
)