What is the value of the expression 00 1000 in java Explain
What is the value of the expression 0.0 *(1.0/0.0) in java? Explain why it is has this value.
Solution
Please follow the data and description :
Division by Zero :
For the given case the result displayed is NaN (Not a Number). In the stream of java, the divide by zero in case of integers throws an exception that is done automatically. But this is not seen in the case of the double or the float. That\'s because integers don\'t have values for +/-Inf, NaN, and don\'t allow division by 0, while floats do have those special values. The basic reason behind that is it implements the floating point arithmetic algorithm which specifies a special values like \"Not a number\" OR \"infinity\" for \"divided by zero cases\" as per IEEE 754 standards.
Hope this is helpful.
