floating point - Java subtraction of floats is infinity? -


मेरे डीबगर में मैं निम्न मान देख सकता हूँ:

  float min = -3.1931721E38 फ्लोट अधिकतम = 3.3434891 ई38 फ्लोट टेम्पप = (अधिकतम-न्यूनतम);  

यह अनन्तता में परिणाम है। ऐसा क्यों है? (2-2 ^ 23) · 2 ^ 127 अस्थायी चर अधिकार से बड़ा है?

गणितीय इस घटाव का परिणाम सबसे बड़ा संभव फ़्लोट मान से अधिक है जावा फ़्लोटिंग-अंक अंकगणित के लिए आईईईई नियमों का पालन करता है, जिसके परिणामस्वरूप अनंत

यदि आप परिणाम चाहते हैं, तो आप इसके बजाय double s का उपयोग कर सकते हैं , जो अधिक सटीक और मान्य मानों की एक बहुत बड़ी रेंज है।


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)? -