+ 7
[Why] java any logical reason behind this concpet
as int a=3/0; // output is arithmetic exception: why not infinity; double b=3.0/0; //output is infinity: why not arithmetic exception;
1 ответ
+ 8
The simple answer is a double is a floating point number and complies with the IEEE 754 standard for floating point arithmetic, which states:
>The value of this constant is the result of dividing a positive {or negative} number by zero.