kaschimer


Comments:

Divide by Zero

posted by kaschimerkaschimer(170) 5 years, 10 months ago 0

From MSDN (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdoubleclasstopic.asp):

The Double value type represents a double-precision 64-bit number with values ranging from negative 1.79769313486232e308 to positive 1.79769313486232e308, as well as positive or negative zero, PositiveInfinity, NegativeInfinity, and Not-a-Number (NaN).

The floating-point operators, including the assignment operators, do not throw exceptions. Instead, in exceptional situations, the result of a floating-point operation is zero, infinity, or NaN, as described below:

If the result of a floating-point operation is too small for the destination format, the result of the operation is zero.
If the magnitude of the result of a floating-point operation is too large for the destination format, the result of the operation is PositiveInfinity or NegativeInfinity, as appropriate for the sign of the result.
If a floating-point operation is invalid, the result of the operation is NaN.
If one or both operands of a floating-point operation are NaN, the result of the operation is NaN.

Reply