Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DivideByZeroException Class

The exception that is thrown when there is an attempt to divide an integral or decimal value by zero.

For a list of all members of this type, see DivideByZeroException Members.

System.Object
   System.Exception
      System.SystemException
         System.ArithmeticException
            System.DivideByZeroException

[Visual Basic]
<Serializable>
Public Class DivideByZeroException
   Inherits ArithmeticException
[C#]
[Serializable]
public class DivideByZeroException : ArithmeticException
[C++]
[Serializable]
public __gc class DivideByZeroException : public
   ArithmeticException
[JScript]
public
   Serializable
class DivideByZeroException extends ArithmeticException

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

Dividing a floating-point value by zero will result in either positive infinity, negative infinity, or Not-a-Number (NaN) according to the rules of IEEE 754 arithmetic. Floating-point operations never throw an exception. For more information, see Single and Double.

The following Microsoft intermediate language (MSIL) instructions throw DivideByZeroException:

  • div
  • div.un
  • rem
  • rem.un

DivideByZeroException uses the HRESULT COR_E_DIVIDEBYZERO, which has the value 0x80020012.

For a list of initial property values for an instance of DivideByZeroException, see the DivideByZeroException constructors.

Requirements

Namespace: System

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: Mscorlib (in Mscorlib.dll)

See Also

DivideByZeroException Members | System Namespace | Exception | Handling and Throwing Exceptions

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.