posted 20 years ago
When casting double to byte, the value of the double is converted to an int first, and then from int to byte.
So, when you convert infinity to int, you get 0x7fffffff. When you convert 0x7fffffff to byte, you get 0xff, which is -1.