Cheers,<br />Jay<br /> <br />(SCJP 1.4)<br />Heights of great men were not achieved in one day, they were toiling day and night while their companions slept.
vas vas
Greenhorn
Joined: Dec 13, 2004
Posts: 19
posted
0
Hi,
Unlike Integer class in java, Float has a field called NaN. A constant holding a Not-a-Number value of type float.
so when you do 12.0/0 , this is NaN.This is not the same with integers.You get an exception when you do 12/0 , but not whne 12.0/0.
Hope this helps. Suman Tedla.
Joe Borderi
Ranch Hand
Joined: Oct 23, 2004
Posts: 151
posted
0
"so when you do 12.0/0 , this is NaN."
12.0/0 is POSITIVE_INFINITY. NaN results from performing Java operations that result in "Not a Number", such as taking the square root of a negative number.
Srinivasa Raghavan
Ranch Hand
Joined: Sep 28, 2004
Posts: 1228
posted
0
Is this even same for double ? I mean does double has a NAN const.