将浮点值除以零不会引发异常;根据 IEEE 754 算法的规则, 它会产生正无穷、负无穷或非数字 (NaN)。Dividing a floating-point value by zero doesn't throw an exception; it results in positive infinity, negative infinity, or not a number (NaN), according to the rules of IEEE 754 arithmetic.由于下面的示例使用浮点除法而不是整数除法, 因此操作不会引发DivideByZeroException异常。Because the following example uses floating-point division rather than integer division, the operation does not throw a DivideByZeroException exception.

使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 DivideByZeroException 类的新实例。Initializes a new instance of the DivideByZeroException class with a specified error message and a reference to the inner exception that is the cause of this exception.