{"id":10006338,"date":"2022-08-29T17:10:44","date_gmt":"2022-08-29T09:10:44","guid":{"rendered":"https:\/\/ityet.com\/?p=10006338"},"modified":"2022-08-29T17:10:44","modified_gmt":"2022-08-29T09:10:44","slug":"%e8%b8%a9%e5%9d%91%e4%ba%86%ef%bc%810%e4%bd%9c%e4%b8%ba%e9%99%a4%e6%95%b0%ef%bc%8c%e4%b8%8d%e4%b8%80%e5%ae%9a%e4%bc%9a%e6%8a%9b%e5%87%ba%e5%bc%82%e5%b8%b8%ef%bc%81","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10006338","title":{"rendered":"\u8e29\u5751\u4e86\uff010\u4f5c\u4e3a\u9664\u6570\uff0c\u4e0d\u4e00\u5b9a\u4f1a\u629b\u51fa\u5f02\u5e38\uff01"},"content":{"rendered":"<p>\u4f60\u597d\u5440\uff0c\u6211\u662f\u6b6a\u6b6a\u3002<\/p>\n<p>\u8e29\u5751\u4e86\u554a\uff0c\u53c8\u8e29\u5751\u4e86\u554a\uff01<\/p>\n<p>\u8fd9\u6b21\u8e29\u5230\u4e00\u4e2a\u7279\u522b\u65e0\u8bed\u7684\u5e38\u8bc6\u5751\u3002\u77e5\u9053\u771f\u76f8\u7684\u90a3\u4e00\u523b\uff0c\u4eba\u5c31\u662f\u6574\u4e2a\u9ebb\u6389\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393983\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u5148\u4e0a\u4e2a\u4ee3\u7801\uff1a<\/p>\n<pre><code>private static double calculate(double a, int b) {\n    return a \/ b;\n}<\/code><\/pre>\n<p>\u4f60\u5148\u522b\u95ee\u4e3a\u4ec0\u4e48\u8ba1\u7b97\u4e0d\u7528 BigDecimal\uff0c\u53cd\u6b63\u7a0b\u5e8f\u91cc\u9762\u5c31\u662f\u6709\u4e00\u4e2a\u7c7b\u4f3c\u4e8e\u8fd9\u6837\u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u6b63\u5e38\u7528\u8d77\u6765\u4e5f\u6ca1\u5565\u6bdb\u75c5\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393984\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u6ce8\u610f\uff0c\u6211\u8bf4\u7684\u662f\u201c\u6b63\u5e38\u4f7f\u7528\u770b\u8d77\u6765\u6ca1\u6bdb\u75c5\u201d\uff0c\u4e0d\u6b63\u5e38\u4f7f\u7528\u662f\u600e\u4e48\u6837\u7684\u5462\uff1f<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393985\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u770b\u5230\u8f93\u51fa\u7ed3\u679c\u662f \u201cInfinity\u201d \u7684\u65f6\u5019\uff0c\u6211\u751a\u81f3\u63c9\u4e86\u4e00\u4e0b\u773c\u775b\uff0c\u4ee5\u4e3a\u81ea\u5df1\u662f\u8fc7\u4e8e\u70ed\u7231\u5de5\u4f5c\uff0c\u5bfc\u81f4\u7528\u773c\u8fc7\u5ea6\uff0c\u770b\u82b1\u4e86\u3002<\/p>\n<p>\u6709\u4e00\u8bf4\u4e00\uff0c\u6211\u771f\u6ca1\u89c1\u8fc7\u8fd9\u73a9\u610f\u3002\u4f46\u662f\u8fd9\u4e2a\u5355\u8bcd\u6211\u8ba4\u8bc6\u554a\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393986\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u5728\u6211\u6709\u9650\u7684\u8ba4\u77e5\u91cc\u9762\uff0c 0 \u662f\u4e0d\u53ef\u4ee5\u4f5c\u4e3a\u9664\u6570\u7684\uff0c\u5982\u679c\u4f5c\u4e3a\u9664\u6570\u4f1a\u629b\u51fa\u5f02\u5e38\u624d\u5bf9\u3002<\/p>\n<p>\u4f46\u662f\u8fd9\u4e2a\u7b80\u5355\u7684\u6848\u4f8b\u6253\u7834\u4e86\u6211\u7684\u8ba4\u77e5\uff0c\u5b83\u4e0d\u4ec5\u6ca1\u6709\u629b\u51fa\u5f02\u5e38\uff0c\u8fd8\u7ed9\u6211\u4e86\u4e00\u4e2a\u201c\u65e0\u7a77\u5927\u7684\u6570\u201d\u3002<\/p>\n<p>\u5728\u4e00\u8138\u61f5\u903c\u4e2d\uff0c\u6211\u77e5\u9053\uff0c\u7d20\u6750\u8fd9\u4e0d\u5c31\u6765\u4e86\u561b\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393987\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<h2>\u641c\u7d22\u4e00\u756a<\/h2>\n<p>\u5982\u679c\u662f\u5728\u4f7f\u7528\u6846\u67b6\u7684\u8fc7\u7a0b\u4e2d\u9047\u5230\u95ee\u9898\uff0c\u4e00\u822c\u6765\u8bf4\u6211\u662f\u5148\u81ea\u5df1\u8c03\u8bd5\u4e00\u4e0b\uff0c\u6323\u624e\u4e00\u6ce2\uff0c\u770b\u770b\u662f\u4e0d\u662f\u81ea\u5df1\u7684\u6253\u5f00\u65b9\u5f0f\u4e0d\u5bf9\u3002<\/p>\n<p>\u4f46\u662f\u8fd9\u4e2a\u95ee\u9898\u592a\u7b80\u5355\u4e86\uff0c\u4ee5\u81f3\u4e8e\u6211\u751a\u81f3\u627e\u4e0d\u5230\u8c03\u8bd5\u7684\u89d2\u5ea6\u3002<\/p>\n<p>\u600e\u4e48\u529e\uff1f<\/p>\n<p>\u53ea\u6709\u76f4\u63a5\u62ff\u51fa\u7a0b\u5e8f\u5458\u7684\u7956\u4f20\u6280\u80fd\u4e86\uff1a\u9762\u5411\u6d4f\u89c8\u5668\u7f16\u7a0b\u3002<\/p>\n<p>\u4e8e\u662f\u6211\u8f93\u5165\u641c\u7d22\u5173\u952e\u5b57 \u201cJava Infinity\u201d\uff0c\u6392\u5728\u7b2c\u4e00\u7684\u662f\u67d0\u535a\u5ba2\u7f51\u7ad9\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393988\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u6211\u4e2a\u4eba\u662f\u4e0d\u592a\u559c\u6b22\u8fd9\u4e2a\u7f51\u7ad9\uff0c\u6240\u4ee5\u6211\u6309\u7167\u4e2a\u4eba\u4e60\u60ef\u91cd\u65b0\u641c\u7d22\u4e86\u4e00\u6b21\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393989\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u627e\u5230\u4e86\u4e0b\u9762\u8fd9\u4e2a\u94fe\u63a5\uff1a<\/p>\n<blockquote><p><a href=\"https:\/\/link.segmentfault.com\/?enc=RUY%2BWLmd%2Fqv9tCnvxx8udw%3D%3D.%2F3t059PB%2BRgJZnNbClVjGa4RBWUxoQiVrE457JTNx6359FPk089gmj%2F0xQlBZV4A\" rel=\"nofollow\">https:\/\/www.cnblogs.com\/zhisu&#8230;<\/a><\/p><\/blockquote>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393990\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u4ece\u8fd9\u7bc7\u6587\u7ae0\u4e2d\u6211\u77e5\u9053\u4e86\uff0c\u539f\u6765\u5728\u6211\u7684\u8ba4\u77e5\u91cc\u9762\uff0c0 \u4f5c\u4e3a\u9664\u6570\u4f1a\u629b\u51fa\u4e0b\u9762\u8fd9\u4e2a\u5f02\u5e38\uff0c\u8fd8\u6709\u4e00\u4e2a\u524d\u63d0\u662f\u201c\u6574\u578b\u8fd0\u7b97\u201d\uff1a<\/p>\n<blockquote><p>java.lang.ArithmeticException: \/ by zero<\/p><\/blockquote>\n<p>\u5728 Double \u548c Float \u91cc\u9762\u90fd\u5b9a\u4e49\u4e86\u201c\u6b63\u65e0\u7a77\u201d\u548c\u201c\u8d1f\u65e0\u7a77\u201d\u8fd9\u4e24\u4e2a\u5e38\u91cf\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393991\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393992\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u73b0\u5728\u6211\u77e5\u9053\u5728\u6d6e\u70b9\u8fd0\u7b97\u7684\u65f6\u5019\uff0c0 \u662f\u53ef\u4ee5\u4f5c\u4e3a\u9664\u6570\u7684\u3002<\/p>\n<p>\u4f46\u662f\uff0c\u4e3a\u4ec0\u4e48\u5462\uff1f<\/p>\n<p>Java \u91cc\u9762\u4ec0\u4e48\u8fd9\u6837\u8bbe\u8ba1\u5462\uff0c\u4e3a\u4ec0\u4e48\u4e0d\u4e00\u89c6\u540c\u4ec1\u5462\uff1f<\/p>\n<p>\u535a\u5ba2\u91cc\u9762\u6ca1\u6709\u5199\uff0c\u4f46\u662f\u6211\u77e5\u9053\u8981\u627e\u5230\u8fd9\u4e2a\u95ee\u9898\u7684\u7b54\u6848\uff0c\u8fd9\u4e2a\u5730\u65b9\u53ef\u4ee5\u53bb\u770b\u770b\uff1a<\/p>\n<blockquote><p><a href=\"https:\/\/link.segmentfault.com\/?enc=nMqImd6a0Qiz%2Bo4bJ2ujJA%3D%3D.gFeK5H62Rb7m9Xj2Cxo%2B%2B3cRnntA7BQHReCTF6JJGZc%3D\" rel=\"nofollow\">https:\/\/stackoverflow.com\/<\/a><\/p><\/blockquote>\n<p>\u4e8e\u662f\u6211\u7528 \u201cJava Double Float Infinity\u201d \u5173\u952e\u5b57\u53bb\u67e5\u8be2\u4e86\u4e00\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393993\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u5f88\u5bb9\u6613\u5c31\u627e\u5230\u4e86\u8fd9\u4e2a\u94fe\u63a5\uff1a<\/p>\n<blockquote><p><a href=\"https:\/\/link.segmentfault.com\/?enc=kgH1DVfaUyfX6YlfBH2JNQ%3D%3D.%2Fl7QB3mwic8qlDhSReGo1etvlXUzsyRW6T7Z0f3eEb30%2BcUCMEqH%2FGgTtZ9xMUnvXfg%2F0PWwGKT%2FWOnd3FatNLcT4iJdHNysRFxqs1s2Jvmpn1RH310%2BYfv3uGGq8k9%2F3NzwhVs6mmnzzEIoiQeeTZD6b%2FkzAdgHCzsGCfEtvy0%3D\" rel=\"nofollow\">https:\/\/stackoverflow.com\/que&#8230;<\/a><\/p><\/blockquote>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393994\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u8fd9\u4e2a\u63d0\u95ee\u8005\u63d0\u51fa\u7684\u95ee\u9898\u7ffb\u8bd1\u8fc7\u6765\uff0c\u548c\u6211\u524d\u9762\u9047\u5230\u7684\u95ee\u9898\u4e00\u6a21\u4e00\u6837\uff1a<\/p>\n<blockquote><p>\u4e3a\u4ec0\u4e48\u7528 Float \u6216\u8005 Double \u9664\u4ee5\u96f6\u4e0d\u4f1a\u629b\u51fa java.lang.ArithmeticExceptionL:\/by zero \u5f02\u5e38\uff1f<\/p><\/blockquote>\n<p>\u8fd9\u4e2a\u95ee\u9898\u4e0b\u7684\u9ad8\u8d5e\u56de\u7b54\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393995\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u95ee\u9898\u7684\u7ec8\u6781\u7b54\u6848\u5c31\u85cf\u5728\u8fd9\u4e2a\u9ad8\u8d5e\u56de\u7b54\u4e2d\uff0c\u6211\u7ed9\u4f60\u89e3\u6790\u4e00\u756a\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393996\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<h2>\u63ed\u79d8<\/h2>\n<p>\u8fd9\u4e2a\u9ad8\u8d5e\u56de\u7b54\uff0c\u5176\u5b9e\u5c31\u53ea\u6709\u4e00\u53e5\u8bdd\uff1a<\/p>\n<blockquote><p>In short, that&#8217;s the way it&#8217;s specified in the IEEE-754 standard, which is what Java&#8217;s Floating-Point Operations are based on.<\/p><\/blockquote>\n<p>\u5176\u4ed6\u7684\u90e8\u5206\u90fd\u662f\u5f15\u7528\u3002<\/p>\n<p>\u5728\u8fd9\u4e00\u53e5\u8bdd\u4e2d\uff0c\u4ed6\u63d0\u5230\u4e86\u4e24\u4e2a\u5173\u952e\u7684\u4e1c\u897f\uff1a<\/p>\n<ul>\n<li>IEEE-754 standard<\/li>\n<li>Java&#8217;s Floating-Point Operations<\/li>\n<\/ul>\n<p>\u610f\u601d\u5c31\u662f Java \u7684\u6d6e\u70b9\u8fd0\u7b97\u662f\u57fa\u4e8e IEEE-754 \u6807\u51c6\u6765\u7684\u3002<\/p>\n<p>\u4ed6\u7ed9\u7684\u5176\u4e2d\u4e00\u4e2a\u8d85\u94fe\u63a5\u662f Java \u8bed\u8a00\u89c4\u8303\uff1a<\/p>\n<blockquote><p><a href=\"https:\/\/link.segmentfault.com\/?enc=bH9BXhYzLpBvnteage7hVA%3D%3D.vAfmGoZHO%2Fm%2FxmA81dk6w0MRZLRdZY38H6ht1AR1HNGcd5aXjTabGhb31GFFMBoiDTZjlbMyfE%2FM7td%2BDfisk4c9K2ewQtBGhiRYz1IMLIo%3D\" rel=\"nofollow\">https:\/\/docs.oracle.com\/javas&#8230;<\/a><\/p><\/blockquote>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393997\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>Java \u8bed\u8a00\u89c4\u8303\u8868\u793a\uff1a\u4f60\u8981\u95ee\u6211\u4e3a\u4ec0\u4e48\uff0c\u6211\u53ea\u80fd\u544a\u8bc9\u4f60\u6211\u9075\u5b88\u7684\u662f IEEE 754 \u8fd9\u4e2a\u56fd\u9645\u89c4\u8303\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u522b\u95ee\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393998\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u90a3\u4e48\u8fd9\u4e2a IEEE 754 \u662f\u4e2a\u4ec0\u4e48\u4e1c\u897f\u5462\uff1f<\/p>\n<p>\u6211\u4e5f\u4e0d\u77e5\u9053\uff0c\u6240\u4ee5\u67e5\u4e00\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042393999\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u597d\u5bb6\u4f19\uff0c\u6765\u5934\u8fd8\u4e0d\u5c0f\u3002<\/p>\n<p>IEEE\uff0c\u5168\u79f0 Institute of Electrical and Electronics Engineers\uff0c\u7535\u6c14\u548c\u7535\u5b50\u5de5\u7a0b\u5e08\u534f\u4f1a\u3002<\/p>\n<p>IEEE 754 \u7684\u5168\u79f0\u662f IEEE Standard for Floating-Point Arithmetic\u3002<br \/>\u8868\u793a\u7535\u6c14\u548c\u7535\u5b50\u5de5\u7a0b\u5e08\u534f\u4f1a\u5236\u5b9a\u7684\u6d6e\u70b9\u8fd0\u7b97\u6280\u672f\u6807\u51c6\u3002<\/p>\n<p>Standard\uff0c\u6807\u51c6\uff0c\u4f60\u660e\u767d\u5427\uff1f<\/p>\n<p>\u5f97\u6709\u4e00\u4e9b Standard\uff0c\u6709\u4e9b\u4e8b\u60c5\u624d\u597d\u529e\uff0c\u4e0d\u7136\u5404\u81ea\u4e3a\u6218\uff0c\u5404\u81ea\u517c\u5bb9\uff0c\u96be\u53d7\u7684\u4e00\u6bd4\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u8be5\u6807\u51c6\u662f\u4e3a\u4e86\u89e3\u51b3\u5728\u4e0d\u540c\u7684\u6d6e\u70b9\u5b9e\u73b0\u4e2d\u7684\u5404\u79cd\u95ee\u9898\uff0c\u8fd9\u4e9b\u95ee\u9898\u4f7f\u5b83\u4eec\u96be\u4ee5\u53ef\u9760\u5730\u4f7f\u7528\u548c\u79fb\u690d\u3002<\/p>\n<p>\u4e00\u65e6\u6709\u4e86\u6807\u51c6\uff0c\u5927\u5bb6\u90fd\u9075\u5b88\uff0c\u5c31\u597d\u529e\u4e86\u3002<\/p>\n<p>\u5728\u6807\u51c6\u4e2d\u5c31\u89c4\u5b9a\u4e86\u5bf9\u4e8e\u5f02\u5e38\u5e94\u8be5\u5982\u4f55\u5904\u7406\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042394000\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u6765\uff0c\u6846\u8d77\u6765\u7684\u90e8\u5206\uff0c\u8ddf\u6211\u5927\u58f0\u7684\u6717\u8bfb\u4e00\u904d\uff1a<\/p>\n<blockquote><p>Division by zero: an operation on finite operands gives an exact infinite result, e.g., 1\/0 or log(0). <strong>By default, returns \u00b1infinity.<\/strong><\/p><\/blockquote>\n<p>\u9488\u5bf9\u201c\u9664\u4ee5 0\u201d\u5f02\u5e38\uff0cIEEE 754 \u89c4\u5b9a\uff1a\u5bf9\u6709\u9650\u64cd\u4f5c\u6570\u7684\u8fd0\u7b97\u4f1a\u5f97\u5230\u4e00\u4e2a\u7cbe\u786e\u7684\u65e0\u9650\u7ed3\u679c\uff0c\u4f8b\u5982\uff0c1\/0 \u6216 log(0)\u3002<strong>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8fd4\u56de \u00b1infinity\u3002<\/strong><\/p>\n<p>\u90a3\u4e48\u95ee\u9898\u53c8\u6765\u4e86\uff1f<\/p>\n<p>\u4e3a\u4ec0\u4e48\u6807\u51c6\u4e2d\u8981\u8fd9\u6837\u7684\u89c4\u5b9a\u5462\uff1f<\/p>\n<p>\u5728\u524d\u9762\u63d0\u5230\u7684\u9ad8\u8d5e\u56de\u7b54\u4e2d\uff0c\u7ed9\u5230\u4e86\u8fd9\u6837\u7684\u4e00\u4e2a\u94fe\u63a5\uff1a<\/p>\n<blockquote><p><a href=\"https:\/\/link.segmentfault.com\/?enc=0xveEl%2FeFIxtIuiOjsAPOA%3D%3D.AyCsAZ0Q%2FZu%2BEgkVbMJVuRadjSAltgmZNlt%2B7zNfZA4pQVq4pGeSBk7rozRsBwM3xHDJQ7M3ThpYA9w%2FVOYCRpEt0lWat7NBPduMsHrJJ0JGFjw7beFjltAawXu4cfAc8av5%2BfyCuz0w8n9dXxK00A%3D%3D\" rel=\"nofollow\">https:\/\/web.archive.org\/web\/2&#8230;<\/a><\/p><\/blockquote>\n<p>\u8fd9\u4e2a\u95ee\u9898\u7684\u7b54\u6848\u5c31\u85cf\u5728\u8fd9\u4e2a\u94fe\u63a5\u91cc\u9762\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042394001\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u8bf7\u95ee\uff1a\u4e3a\u4ec0\u4e48\u9664\u4ee5\u96f6\uff08\u6216\u6ea2\u51fa\uff0c\u6216\u4e0b\u6ea2\uff09\u4e0d\u4f1a\u505c\u6b62\u7a0b\u5e8f\u6216\u5f15\u53d1\u9519\u8bef\uff1f<\/p>\n<p>\u4e0b\u9762\u7ed9\u4e86\u4e00\u5927\u6bb5\u56de\u590d\uff0c\u6211\u5c1d\u8bd5\u7740\u7406\u89e3\u4e86\u51e0\u6b21\uff0c\u4f46\u662f\u6211\u53d1\u73b0\u6709\u70b9\u8d85\u7eb2\u4e86\uff0c\u786e\u5b9e\u4e0d\u77e5\u9053\u5177\u4f53\u5565\u610f\u601d\u3002<\/p>\n<p>\u6211\u4e2a\u4eba\u6d45\u663e\u7684\u8ba4\u4e3a\u5b83\u8981\u8868\u8fbe\u7684\u610f\u601d\u662f\uff1a\u8fd9\u73a9\u610f\u4f7f\u7528\u8303\u56f4\u5f88\u5e7f\uff0c\u4e3a\u4e86\u7a0b\u5e8f\u7684\u7a33\u5b9a\u6027\uff0c\u6211\u4e0d\u60f3\u629b\u51fa\u5f02\u5e38\u6765\u7ec8\u6b62\u7a0b\u5e8f\uff0c\u800c\u4f7f\u7528\u8005\u5e94\u8be5\u77e5\u9053\u6211\u8fd9\u4e2a\u201c\u9664 0 \u4e4b\u540e\u662f\u4e00\u4e2a\u65e0\u7a77\u5927\u7684\u6570\u201d\u8fd9\u6837\u7684\u8bbe\u5b9a\u3002<\/p>\n<p>\u6240\u4ee5\u5230\u5e95\u4e3a\u4ec0\u4e48\u5462\uff1f<\/p>\n<p>\u597d\u4e86\uff0c<\/p>\n<p>\u522b\u95ee\u4e86\uff0c<\/p>\n<p>\u5c31\u5230\u8fd9\u5427\u3002<\/p>\n<p>\u518d\u95ee\uff0c<\/p>\n<p>\u5c31\u4e0d\u793c\u8c8c\u4e86\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042394002\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u770b\u5b8c\u4e4b\u540e\uff0c\u4f60\u53ea\u9700\u8981\u8bb0\u4f4f\u4e00\u53e5\u8bdd\uff1a<strong>\u5728 Java \u91cc\u9762\uff0c\u9664\u6570\u4f5c\u4e3a 0\uff0c\u4e0d\u4e00\u5b9a\u4f1a\u629b\u51fa ArithmeticException\uff0c\u5343\u4e07\u4e0d\u8981\u5f62\u6210\u8fd9\u6837\u7684\u56fa\u5316\u601d\u7ef4\uff0c\u4ece\u800c\u5f71\u54cd\u81ea\u5df1\u6392\u9664\u95ee\u9898\u7684\u65b9\u5411\u3002<\/strong><\/p>\n<p>\u6700\u540e\uff0c\u6587\u7ae0\u5168\u7f51\u9996\u53d1\u5728\u5fae\u4fe1\u516c\u4f17\u53f7\uff0c\u6b22\u8fce\u5173\u6ce8\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042184887\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000042393981\">https:\/\/segmentfault.com\/a\/1190000042393981<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f60\u597d\u5440\uff0c\u6211\u662f\u6b6a\u6b6a\u3002 \u8e29\u5751\u4e86\u554a\uff0c\u53c8\u8e29\u5751\u4e86\u554a\uff01 \u8fd9\u6b21\u8e29\u5230\u4e00\u4e2a\u7279\u522b\u65e0\u8bed\u7684\u5e38\u8bc6\u5751\u3002\u77e5\u9053\u771f\u76f8\u7684\u90a3\u4e00\u523b\uff0c\u4eba\u5c31\u662f\u6574\u4e2a\u9ebb\u6389\u3002  [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-10006338","post","type-post","status-publish","format-standard","hentry"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10006338"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006338\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10006338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10006338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10006338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}