posted 19 years ago
hai ranchers,
i know the fact that when a double number is divided by 0 it doesnt result in exception but it results in value of Infinty...
but the problem i have is when i try to type cast this value of infinity to byte...it results in value of -1 ....
sample code...
double d1 = 1.0;
double d2 = 0.0;
d1= d1/d2; //d1 results in Infinity
byte b = (byte) d1; //b gets assisned -1
can u help me understand y it gets this value assigned..
thnks in advance