... On the other hand, if the value of the divisor in an integer division is 0, then an ArithmeticException is thrown. [...] The result of a floating-point division is determined by the specification of IEEE arithmetic: ... - Division of a nonzero finite value by a zero results in a signed infinity. [...] Despite the fact that overflow, underflow, division by zero, or loss of information may occur, evaluation of a floating-point division operator / never throws a run-time exception.
[ July 18, 2002: Message edited by: Valentin Crettaz ]
____________________________________________ float f = 3.0f; float g = f/0; //will not throw any ArithmeticException and g's value will be NaN ________________________________________________ Isnt the value of this Infinity ??? and it would be NaN if it was float f = 0.0f; float g = f/0; Deepali
Joined: Aug 26, 2001
you're right Deepali... I'm sorry the result of float f = 3.0f; float g = f/0; is Infinity and not NaN...