why java is returning positive infinity when it exceed Double.Max_Value? -


When I try to execute this code, the result is more than double. MAX_Value? Overflow / Underflow will affect double data types in Java?

Code:

  Results = Double. MAX_VALUE * double. MAX_VALUE; If the (result & gt; double.mx_avna) {// some return details}  

From

The result is the floating point multiplication set based on IEEE 754 arithmetic rules:

  • [...]
  • < Li> If the volume of the product is too large to represent, then we say operation overflow ; The result is then the eternal sign of the appropriate sign

Since Double.MAX_VALUE * Double.MAX_VALUE It is big, its value becomes infinite.


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -