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

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -