{"id":294861,"date":"2024-05-20T15:20:50","date_gmt":"2024-05-20T07:20:50","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/294861.html"},"modified":"2024-05-20T15:20:58","modified_gmt":"2024-05-20T07:20:58","slug":"int%e5%92%8cfloat%e7%9a%84%e5%8c%ba%e5%88%ab%e6%98%af%e4%bb%80%e4%b9%88%ef%bc%8cd","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/294861.html","title":{"rendered":"int\u548cfloat\u7684\u533a\u522b\u662f\u4ec0\u4e48\uff0c%d"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/27141933\/eba85fbc-a31d-4185-b5ab-cef6a655c915.webp\" alt=\"int\u548cfloat\u7684\u533a\u522b\u662f\u4ec0\u4e48\uff0c%d\" \/><\/p>\n<p><p><strong>\u6574\u578b(int)\u548c\u6d6e\u70b9\u578b(float)\u4e3b\u8981\u533a\u522b\u5728\u4e8e\u80fd\u591f\u8868\u793a\u7684\u6570\u503c\u8303\u56f4\u548c\u7cbe\u5ea6<\/strong>\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u6574\u578b\u662f\u7528\u6765\u8868\u793a<strong>\u6ca1\u6709\u5c0f\u6570\u90e8\u5206\u7684\u6570<\/strong>\uff0c\u800c\u6d6e\u70b9\u578b\u5219\u7528\u4e8e\u8868\u793a<strong>\u53ef\u4ee5\u6709\u5c0f\u6570\u90e8\u5206\u7684\u6570<\/strong>\u3002\u6b64\u5916\uff0c\u5b83\u4eec\u5728\u5185\u5b58\u4e2d\u7684\u5b58\u50a8\u65b9\u5f0f\u548c\u5904\u7406\u901f\u5ea6\u4e5f\u5b58\u5728\u5dee\u5f02\u3002<strong>\u6574\u578b\u901a\u5e38\u7528\u4e8e\u8ba1\u6570\u6216\u7d22\u5f15\u6570\u7ec4<\/strong>\uff0c\u800c\u6d6e\u70b9\u578b\u5219\u66f4\u9002\u5408\u8fdb\u884c\u79d1\u5b66\u8ba1\u7b97\u6216\u9700\u8981\u7cbe\u786e\u5c0f\u6570\u70b9\u540e\u51e0\u4f4d\u7684\u573a\u5408\u3002\u5728\u591a\u6570\u7f16\u7a0b\u73af\u5883\u4e2d\uff0c\u6574\u578b\u6570\u636e\u5360\u7528\u7684\u7a7a\u95f4\u5c0f\u4e8e\u6d6e\u70b9\u578b\u6570\u636e\uff0c\u56e0\u6b64\uff0c\u6574\u578b\u7684\u5904\u7406\u901f\u5ea6\u901a\u5e38\u6bd4\u6d6e\u70b9\u578b\u5feb\u3002<\/p>\n<\/p>\n<p><p>\u5bf9\u4e8e\u6574\u578b\u548c\u6d6e\u70b9\u578b\u5728\u5185\u5b58\u4e2d\u7684\u5b58\u50a8\u65b9\u5f0f\uff0c\u6574\u578b\u6309\u7167\u786e\u5207\u7684\u6570\u503c\u5b58\u50a8\uff0c\u4e0d\u4fdd\u7559\u5c0f\u6570\u90e8\u5206\u3002\u4f8b\u5982\uff0c\u4e00\u4e2a32\u4f4d\u7684\u6574\u578b\u53ef\u4ee5\u76f4\u63a5\u5b58\u50a8\u6574\u6570\u503c\uff0c\u6ca1\u6709\u4efb\u4f55\u7684\u5c0f\u6570\u7cbe\u5ea6\u635f\u5931\u3002\u800c\u6d6e\u70b9\u578b\u5219\u590d\u6742\u8bb8\u591a\uff0c\u5b83\u91c7\u7528\u79d1\u5b66\u8bb0\u6570\u6cd5\u7684\u65b9\u5f0f\u5b58\u50a8\uff0c\u5206\u4e3a\u7b26\u53f7\u4f4d\u3001\u6307\u6570\u4f4d\u548c\u5c3e\u6570\u4f4d\u4e09\u4e2a\u90e8\u5206\u6765\u8868\u793a\u4e00\u4e2a\u6570\u3002\u8fd9\u79cd\u8868\u793a\u65b9\u5f0f\u53ef\u4ee5\u7528\u6765\u5b58\u50a8\u975e\u5e38\u5927\u6216\u975e\u5e38\u5c0f\u7684\u6570\u503c\uff0c\u4f46\u4f1a\u6709\u7cbe\u5ea6\u4e0a\u7684\u635f\u5931\u3002\u7279\u522b\u662f\u5f53\u8fdb\u884c\u8fde\u7eed\u7684\u6570\u5b66\u8fd0\u7b97\u65f6\uff0c\u8fd9\u79cd\u7cbe\u5ea6\u635f\u5931\u53ef\u80fd\u4f1a\u79ef\u7d2f\uff0c\u5bfc\u81f4\u6700\u7ec8\u7ed3\u679c\u4e0e\u9884\u671f\u6709\u6240\u504f\u5dee\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u6570\u503c\u8303\u56f4\u4e0e\u7cbe\u5ea6<\/h2>\n<\/p>\n<p><p>\u6574\u578b\u548c\u6d6e\u70b9\u578b\u6700\u660e\u663e\u7684\u533a\u522b\u4e4b\u4e00\u5c31\u5728\u4e8e\u5b83\u4eec\u80fd\u8868\u793a\u7684\u6570\u503c\u8303\u56f4\u548c\u7cbe\u5ea6\u3002<\/p>\n<\/p>\n<p><h3>\u6574\u578b<\/h3>\n<\/p>\n<p><p>\u6574\u578b\uff08int\uff09\u5728\u4e0d\u540c\u7684\u7f16\u7a0b\u8bed\u8a00\u6216\u4e0d\u540c\u7684\u7cfb\u7edf\u5e73\u53f0\u4e0a\uff0c\u5176\u8868\u793a\u7684\u6700\u5927\u6700\u5c0f\u503c\u53ef\u80fd\u6709\u6240\u4e0d\u540c\u3002\u5178\u578b\u5730\uff0c32\u4f4d\u7684\u6574\u578b\u53ef\u4ee5\u8868\u793a\u7684\u6570\u503c\u8303\u56f4\u662f\u4ece-2,147,483,648\u52302,147,483,647\u300264\u4f4d\u6574\u578b\u7684\u6570\u503c\u8303\u56f4\u66f4\u5927\uff0c\u80fd\u5904\u7406\u66f4\u5927\u7684\u6574\u6570\u3002\u6574\u578b\u9002\u5408\u7528\u4e8e\u9700\u8981\u7cbe\u786e\u6574\u6570\u503c\u7684\u8ba1\u7b97\u573a\u666f\uff0c\u5982\u8ba1\u6570\u3001\u5faa\u73af\u63a7\u5236\u3001\u6570\u7ec4\u7d22\u5f15\u7b49\u3002<\/p>\n<\/p>\n<p><h3>\u6d6e\u70b9\u578b<\/h3>\n<\/p>\n<p><p>\u6d6e\u70b9\u578b\uff08float\u3001double\uff09\u80fd\u8868\u793a\u7684\u8303\u56f4\u6bd4\u6574\u578b\u5927\u5f97\u591a\uff0c\u4f46\u662f\u5b83\u4eec\u7684\u7cbe\u5ea6\u662f\u6709\u9650\u7684\u3002\u6d6e\u70b9\u578b\u901a\u8fc7\u5206\u914d\u4e00\u90e8\u5206\u4f4d\u6765\u5b58\u50a8\u6307\u6570\uff0c\u53e6\u4e00\u90e8\u5206\u4f4d\u5b58\u50a8\u5c3e\u6570\uff08\u5373\u5c0f\u6570\u90e8\u5206\uff09\uff0c\u56e0\u6b64\u80fd\u591f\u8868\u793a\u975e\u5e38\u5927\u6216\u975e\u5e38\u5c0f\u7684\u6570\u503c\u3002\u7136\u800c\uff0c\u8fd9\u4e5f\u610f\u5473\u7740\u5b58\u50a8\u7a7a\u95f4\u53d7\u9650\uff0c\u4e0d\u80fd\u7cbe\u786e\u8868\u793a\u6240\u6709\u7684\u5c0f\u6570\u70b9\u540e\u7684\u6570\u5b57\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u820d\u5165\u8bef\u5dee\u3002\u8fd9\u5bf9\u4e8e\u79d1\u5b66\u8ba1\u7b97\u7b49\u9700\u8981\u9ad8\u7cbe\u5ea6\u7684\u573a\u5408\u53ef\u80fd\u4f1a\u5e26\u6765\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><h2>\u4e8c\u3001\u5b58\u50a8\u4e0e\u6027\u80fd<\/h2>\n<\/p>\n<p><p>\u6574\u578b\u548c\u6d6e\u70b9\u578b\u5728\u5185\u5b58\u4e2d\u7684\u5b58\u50a8\u65b9\u5f0f\u4e0d\u540c\uff0c\u8fd9\u76f4\u63a5\u5f71\u54cd\u4e86\u5b83\u4eec\u7684\u5904\u7406\u901f\u5ea6\u548c\u4f7f\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h3>\u6574\u578b<\/h3>\n<\/p>\n<p><p>\u6574\u578b\u6570\u636e\u7684\u5b58\u50a8\u548c\u5904\u7406\u76f8\u5bf9\u7b80\u5355\u76f4\u63a5\u3002\u5728\u5927\u591a\u6570\u5904\u7406\u5668\u67b6\u6784\u4e2d\uff0c\u6574\u6570\u8fd0\u7b97\u901f\u5ea6\u5f88\u5feb\uff0c\u7279\u522b\u662f\u52a0\u51cf\u4e58\u9664\u8fd9\u6837\u7684\u57fa\u672c\u8fd0\u7b97\u3002\u56e0\u6b64\uff0c\u5728\u4e0d\u9700\u8981\u5c0f\u6570\u7684\u573a\u5408\u4f18\u5148\u9009\u62e9\u6574\u578b\uff0c\u53ef\u4ee5\u63d0\u9ad8\u7a0b\u5e8f\u7684\u8fd0\u884c\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h3>\u6d6e\u70b9\u578b<\/h3>\n<\/p>\n<p><p>\u6d6e\u70b9\u578b\u6570\u636e\u7684\u5b58\u50a8\u548c\u5904\u7406\u8981\u590d\u6742\u5f97\u591a\u3002\u6d6e\u70b9\u8fd0\u7b97\u5355\u5143\u901a\u5e38\u6bd4\u6574\u6570\u8fd0\u7b97\u5355\u5143\u66f4\u590d\u6742\uff0c\u5904\u7406\u901f\u5ea6\u4e5f\u76f8\u5bf9\u8f83\u6162\u3002\u800c\u4e14\uff0c\u7531\u4e8e\u820d\u5165\u8bef\u5dee\u7684\u5b58\u5728\uff0c\u6d89\u53ca\u6d6e\u70b9\u578b\u6570\u636e\u7684\u8fd0\u7b97\u53ef\u80fd\u9700\u8981\u66f4\u5c0f\u5fc3\u5730\u5904\u7406\u4ee5\u907f\u514d\u8bef\u5dee\u7d2f\u79ef\u3002\u4e0d\u8fc7\uff0c\u5728\u5904\u7406\u6d89\u53ca\u5c0f\u6570\u7684\u590d\u6742\u8ba1\u7b97\uff0c\u5982\u79d1\u5b66\u8ba1\u7b97\u3001\u56fe\u5f62\u5904\u7406\u65f6\uff0c\u4f7f\u7528\u6d6e\u70b9\u578b\u662f\u4e0d\u53ef\u907f\u514d\u7684\u3002<\/p>\n<\/p>\n<p><h2>\u4e09\u3001\u5e94\u7528\u573a\u666f\u5bf9\u6bd4<\/h2>\n<\/p>\n<p><p>\u6574\u578b\u548c\u6d6e\u70b9\u578b\u5404\u81ea\u6700\u9002\u5408\u7684\u4f7f\u7528\u573a\u666f\u6709\u6240\u4e0d\u540c\uff0c\u6839\u636e\u5b9e\u9645\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u6570\u636e\u7c7b\u578b\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<\/p>\n<p><h3>\u6574\u578b<\/h3>\n<\/p>\n<p><p>\u6574\u578b\u7279\u522b\u9002\u7528\u4e8e\u9700\u8981\u7cbe\u786e\u8ba1\u6570\u7684\u60c5\u51b5\uff0c\u5982\u5faa\u73af\u6b21\u6570\u3001\u6570\u7ec4\u7d22\u5f15\u3001\u6574\u6570\u8fd0\u7b97\u7b49\u573a\u5408\u3002\u5728\u8fd9\u4e9b\u573a\u666f\u4e0b\uff0c\u4f7f\u7528\u6574\u578b\u65e2\u53ef\u4ee5\u4fdd\u8bc1\u7cbe\u786e\u6027\uff0c\u53c8\u80fd\u63d0\u9ad8\u7a0b\u5e8f\u7684\u8fd0\u884c\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h3>\u6d6e\u70b9\u578b<\/h3>\n<\/p>\n<p><p>\u5bf9\u4e8e\u9700\u8981\u5904\u7406\u5b9e\u6570\u3001\u5c0f\u6570\u70b9\u6570\u8fd0\u7b97\u7684\u5e94\u7528\u573a\u666f\uff0c\u5982\u79d1\u5b66\u8ba1\u7b97\u3001\u91d1\u878d\u8ba1\u7b97\u3001\u56fe\u5f62\u5904\u7406\u7b49\uff0c\u6d6e\u70b9\u578b\u5c31\u663e\u793a\u51fa\u4e86\u5176\u4e0d\u53ef\u66ff\u4ee3\u6027\u3002\u5c3d\u7ba1\u5b58\u5728\u820d\u5165\u8bef\u5dee\u7684\u53ef\u80fd\uff0c\u4f46\u901a\u8fc7\u5408\u7406\u7684\u8bbe\u8ba1\u548c\u7cbe\u786e\u7684\u7b97\u6cd5\uff0c\u53ef\u4ee5\u5728\u5f88\u5927\u7a0b\u5ea6\u4e0a\u51cf\u5c11\u8bef\u5dee\uff0c\u6ee1\u8db3\u5e94\u7528\u9700\u6c42\u3002<\/p>\n<\/p>\n<p><h2>\u56db\u3001\u793a\u4f8b\u4e0e\u6ce8\u610f\u4e8b\u9879<\/h2>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u7f16\u7a0b\u4e2d\uff0c\u6b63\u786e\u5730\u9009\u62e9\u548c\u4f7f\u7528\u6574\u578b\u4e0e\u6d6e\u70b9\u578b\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002\u4e0b\u9762\u901a\u8fc7\u51e0\u4e2a\u4f8b\u5b50\u6765\u5177\u4f53\u8bf4\u660e\u3002<\/p>\n<\/p>\n<p><h3>\u6574\u578b\u4f7f\u7528\u793a\u4f8b<\/h3>\n<\/p>\n<p><p>\u5047\u8bbe\u4f60\u6b63\u5728\u7f16\u5199\u4e00\u4e2a\u7a0b\u5e8f\u6765\u7edf\u8ba1\u7528\u6237\u70b9\u51fb\u9875\u9762\u7684\u6b21\u6570\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5e94\u8be5\u4f7f\u7528\u6574\u578b\u6765\u8bb0\u5f55\u70b9\u51fb\u6b21\u6570\uff0c\u56e0\u4e3a\u70b9\u51fb\u6b21\u6570\u662f\u6ca1\u6709\u5c0f\u6570\u7684\u6574\u6570\u3002<\/p>\n<\/p>\n<p><h3>\u6d6e\u70b9\u578b\u4f7f\u7528\u793a\u4f8b<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u6b63\u5728\u5f00\u53d1\u4e00\u4e2a\u5929\u6c14\u9884\u62a5\u5e94\u7528\uff0c\u9700\u8981\u5904\u7406\u6c14\u6e29\u4fe1\u606f\u3002\u6c14\u6e29\u901a\u5e38\u662f\u6709\u5c0f\u6570\u7684\uff0c\u56e0\u6b64\u5e94\u8be5\u4f7f\u7528\u6d6e\u70b9\u578b\u6765\u5b58\u50a8\u548c\u5904\u7406\u8fd9\u79cd\u6570\u636e\u3002<\/p>\n<\/p>\n<p><h3>\u6ce8\u610f\u4e8b\u9879<\/h3>\n<\/p>\n<ul>\n<li>\u8fdb\u884c\u6574\u578b\u548c\u6d6e\u70b9\u578b\u8f6c\u6362\u65f6\u8981\u5c0f\u5fc3\uff0c\u907f\u514d\u7cbe\u5ea6\u635f\u5931\u3002<\/li>\n<li>\u5728\u6d89\u53ca\u6d6e\u70b9\u6570\u8fd0\u7b97\u7684\u7a0b\u5e8f\u4e2d\u8003\u8651\u820d\u5165\u8bef\u5dee\u7684\u5f71\u54cd\uff0c\u7279\u522b\u662f\u5728\u8fdb\u884c\u5927\u91cf\u8ba1\u7b97\u65f6\u3002<\/li>\n<li>\u5728\u6027\u80fd\u654f\u611f\u7684\u5e94\u7528\u4e2d\uff0c\u9002\u5f53\u9009\u62e9\u6570\u636e\u7c7b\u578b\uff0c\u4ee5\u4f18\u5316\u7a0b\u5e8f\u7684\u8fd0\u884c\u901f\u5ea6\u3002<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u7406\u89e3\u6574\u578b\u548c\u6d6e\u70b9\u578b\u7684\u533a\u522b\u53ca\u5176\u5404\u81ea\u7684\u4f18\u7f3a\u70b9\uff0c\u53ef\u4ee5\u66f4\u5408\u7406\u5730\u5728\u7a0b\u5e8f\u4e2d\u5e94\u7528\u8fd9\u4e9b\u57fa\u7840\u800c\u91cd\u8981\u7684\u6570\u636e\u7c7b\u578b\uff0c\u4ee5\u8fbe\u5230\u65e2\u6ee1\u8db3\u7cbe\u5ea6\u53c8\u4f18\u5316\u6027\u80fd\u7684\u76ee\u7684\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>1. \u4ec0\u4e48\u662fint\u548cfloat\u6570\u636e\u7c7b\u578b\uff1f\u5b83\u4eec\u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/strong><\/p>\n<p>int\u548cfloat\u662f\u7f16\u7a0b\u8bed\u8a00\u4e2d\u5e38\u89c1\u7684\u6570\u636e\u7c7b\u578b\u3002int\u662f\u6574\u578b\u6570\u636e\u7c7b\u578b\uff0c\u8868\u793a\u6574\u6570\u503c\uff0c\u800cfloat\u662f\u6d6e\u70b9\u578b\u6570\u636e\u7c7b\u578b\uff0c\u8868\u793a\u5e26\u6709\u5c0f\u6570\u90e8\u5206\u7684\u6570\u503c\u3002<\/p>\n<p>\u533a\u522b\uff1a<\/p>\n<ul>\n<li>\u5185\u5b58\u5360\u7528\uff1aint\u6570\u636e\u7c7b\u578b usually \u5360\u75284\u4e2a\u5b57\u8282\u7684\u5185\u5b58\u7a7a\u95f4\uff0c\u800cfloat\u6570\u636e\u7c7b\u578b\u901a\u5e38\u5360\u75288\u4e2a\u5b57\u8282\u7684\u5185\u5b58\u7a7a\u95f4\u3002<\/li>\n<li>\u7cbe\u5ea6\uff1aint\u6570\u636e\u7c7b\u578b\u662f\u7cbe\u786e\u7684\uff0c\u53ef\u4ee5\u8868\u793a\u51c6\u786e\u7684\u6574\u6570\u503c\uff0c\u800cfloat\u6570\u636e\u7c7b\u578b\u662f\u8fd1\u4f3c\u7684\uff0c\u53ea\u80fd\u51c6\u786e\u8868\u793a\u4e00\u5b9a\u8303\u56f4\u5185\u7684\u6d6e\u70b9\u6570\u3002<\/li>\n<li>\u6570\u503c\u8303\u56f4\uff1aint\u6570\u636e\u7c7b\u578b\u7684\u8303\u56f4\u662f\u6709\u9650\u7684\uff0c\u901a\u5e38\u662f-2^31\u52302^31-1\u4e4b\u95f4\u7684\u6574\u6570\uff08\u5177\u4f53\u53d6\u51b3\u4e8e\u7f16\u7a0b\u8bed\u8a00\u7684\u89c4\u8303\uff09\uff0c\u800cfloat\u6570\u636e\u7c7b\u578b\u7684\u8303\u56f4\u8981\u5927\u5f97\u591a\uff0c\u53ef\u4ee5\u8868\u793a\u66f4\u5927\u6216\u66f4\u5c0f\u7684\u6570\u503c\u3002<\/li>\n<li>\u8fd0\u7b97\uff1aint\u6570\u636e\u7c7b\u578b\u53ef\u4ee5\u8fdb\u884c\u57fa\u672c\u7684\u6574\u6570\u8fd0\u7b97\uff0c\u5982\u52a0\u51cf\u4e58\u9664\uff0c\u800cfloat\u6570\u636e\u7c7b\u578b\u8fd8\u53ef\u4ee5\u8fdb\u884c\u6d6e\u70b9\u6570\u7684\u8fd0\u7b97\uff0c\u5982\u6d6e\u70b9\u6570\u7684\u52a0\u51cf\u4e58\u9664\u3001\u6c42\u4f59\u7b49\u3002<\/li>\n<\/ul>\n<p><strong>2. int\u548cfloat\u7684\u5e94\u7528\u573a\u666f\u6709\u54ea\u4e9b\uff1f<\/strong><\/p>\n<p>int\u6570\u636e\u7c7b\u578b\u5e38\u7528\u4e8e\u8868\u793a\u8ba1\u6570\u3001\u7d22\u5f15\u3001\u65e5\u671f\u7b49\u6574\u6570\u503c\uff0c\u4f8b\u5982\u5728\u6570\u7ec4\u7d22\u5f15\u3001\u5faa\u73af\u8ba1\u6570\u3001\u5904\u7406\u65e5\u671f\u76f8\u5173\u7684\u64cd\u4f5c\u65f6\u53ef\u4ee5\u4f7f\u7528int\u3002\u800cfloat\u6570\u636e\u7c7b\u578b\u5e38\u7528\u4e8e\u8868\u793a\u9700\u8981\u7cbe\u786e\u8ba1\u7b97\u7684\u6d6e\u70b9\u6570\uff0c\u4f8b\u5982\u5728\u79d1\u5b66\u8ba1\u7b97\u3001\u7269\u7406\u6a21\u62df\u3001\u91d1\u878d\u5206\u6790\u7b49\u9886\u57df\u4e2d\uff0c\u4f7f\u7528float\u80fd\u66f4\u597d\u5730\u8868\u793a\u548c\u5904\u7406\u5b9e\u6570\u3002<\/p>\n<p><strong>3. \u5728\u4ee3\u7801\u4e2d\u5982\u4f55\u8fdb\u884cint\u548cfloat\u4e4b\u95f4\u7684\u8f6c\u6362\uff1f<\/strong><\/p>\n<p>\u5728\u8bb8\u591a\u7f16\u7a0b\u8bed\u8a00\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u7c7b\u578b\u8f6c\u6362\u64cd\u4f5c\u7b26\uff08\u4f8b\u5982C++\u4e2d\u7684static_cast\uff09\u5c06int\u8f6c\u6362\u4e3afloat\uff0c\u6216\u5c06float\u8f6c\u6362\u4e3aint\u3002\u8fd9\u4e9b\u64cd\u4f5c\u901a\u5e38\u4f1a\u820d\u5f03\u6216\u66f4\u6539\u5c0f\u6570\u90e8\u5206\uff0c\u56e0\u6b64\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6570\u636e\u7684\u7cbe\u5ea6\u635f\u5931\u3002\u5728\u8fdb\u884c\u8f6c\u6362\u65f6\uff0c\u5e94\u8be5\u6ce8\u610f\u9009\u62e9\u5408\u9002\u7684\u8f6c\u6362\u65b9\u5f0f\uff0c\u4ee5\u907f\u514d\u6570\u636e\u7684\u4e22\u5931\u6216\u8bef\u5dee\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u6574\u578b(int)\u548c\u6d6e\u70b9\u578b(float)\u4e3b\u8981\u533a\u522b\u5728\u4e8e\u80fd\u591f\u8868\u793a\u7684\u6570\u503c\u8303\u56f4\u548c\u7cbe\u5ea6\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u6574\u578b\u662f\u7528\u6765\u8868\u793a\u6ca1\u6709\u5c0f\u6570\u90e8\u5206 [&hellip;]","protected":false},"author":3,"featured_media":294872,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/294861"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=294861"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/294861\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/294872"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=294861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=294861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=294861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}