Trying to divide an integer or Decimal number by zero throws a DivideByZeroException exception. To prevent the exception, ensure that the denominator in a division operation with integer or Decimal values is non-zero.
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
Why? Are you porting code from another language which does throw division by zero exceptions and you want to try to keep the ported close as close to the original code as possible?ok, but how do I still a maintain floating point division that also kicks back an exception when someone tries to do division by zero?