{"id":35828,"date":"2024-11-26T15:39:50","date_gmt":"2024-11-26T07:39:50","guid":{"rendered":"https:\/\/fwq.ai\/blog\/35828\/"},"modified":"2024-11-26T15:39:50","modified_gmt":"2024-11-26T07:39:50","slug":"int%e3%80%81integer%e3%80%81double%e3%80%81double-%e6%af%94%e8%be%83%e8%a7%84%e5%88%99%e8%af%a6%e8%a7%a3%ef%bc%9a%e4%b8%ba%e4%bb%80%e4%b9%88-%e6%af%94%e8%be%83%e6%97%b6-a-c","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/35828\/","title":{"rendered":"int\u3001Integer\u3001double\u3001Double \u6bd4\u8f83\u89c4\u5219\u8be6\u89e3\uff1a\u4e3a\u4ec0\u4e48\u201c==\u201d \u6bd4\u8f83\u65f6 a, c \u4e0e\u5176\u4ed6\u53c2\u6570\u4e3a\u771f\uff0c\u800c b \u4e0e d \u4e3a\u5047\uff0cb \u4e0e e \u7f16\u8bd1\u51fa\u9519\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173077202183706.jpg\" class=\"aligncenter\" title=\"int\u3001Integer\u3001double\u3001Double \u6bd4\u8f83\u89c4\u5219\u8be6\u89e3\uff1a\u4e3a\u4ec0\u4e48\u201c==\u201d \u6bd4\u8f83\u65f6 a, c \u4e0e\u5176\u4ed6\u53c2\u6570\u4e3a\u771f\uff0c\u800c b \u4e0e d \u4e3a\u5047\uff0cb \u4e0e e \u7f16\u8bd1\u51fa\u9519\uff1f\u63d2\u56fe\" alt=\"int\u3001Integer\u3001double\u3001Double \u6bd4\u8f83\u89c4\u5219\u8be6\u89e3\uff1a\u4e3a\u4ec0\u4e48\u201c==\u201d \u6bd4\u8f83\u65f6 a, c \u4e0e\u5176\u4ed6\u53c2\u6570\u4e3a\u771f\uff0c\u800c b \u4e0e d \u4e3a\u5047\uff0cb \u4e0e e \u7f16\u8bd1\u51fa\u9519\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>int\u3001integer\u3001double\u3001double \u6bd4\u8f83\u89c4\u5219\u8be6\u89e3<\/strong><\/p>\n<p><strong>\u95ee\u9898\uff1a<\/strong><\/p>\n<p>\u7ed9\u5b9a\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre>int a = 10;\nDouble b = 10.0;\ndouble c = 10;\nDouble d = 10.0;\nInteger e = 10;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4e3a\u4ec0\u4e48 a, c \u4e0e\u5176\u4ed6\u53c2\u6570\u7528 &#8220;==&#8221; \u6bd4\u8f83\u65f6\u90fd\u662f true\uff0c\u4f46\u662f b \u4e0e d \u7528 &#8220;==&#8221; \u6bd4\u8f83\u65f6\u4e3a false\uff0c\u800c b \u4e0e e \u7528 &#8220;==&#8221; \u6bd4\u8f83\u7f16\u8bd1\u51fa\u9519\uff1f<\/p>\n<p><strong>\u56de\u7b54\uff1a<\/strong><\/p>\n<p><strong>int vs. double<\/strong><\/p>\n<p>int \u662f\u4e00\u4e2a\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff0c\u800c double \u662f\u4e00\u4e2a\u5bf9\u8c61\u3002\u5f53 int \u548c double \u8fdb\u884c\u6bd4\u8f83\u65f6\uff0cint \u4f1a\u81ea\u52a8\u8f6c\u6362\u4e3a double\u3002\u6240\u4ee5 a \u548c c \u4e0e b \u548c d \u7684\u6bd4\u8f83\u7ed3\u679c\u90fd\u662f true\uff0c\u56e0\u4e3a 10 \u7b49\u4e8e 10.0\u3002<\/p>\n<p><strong>double vs. double<\/strong><\/p>\n<p>double \u662f\u4e00\u4e2a\u5bf9\u8c61\uff0c\u5bf9\u8c61\u6bd4\u8f83\u7684\u662f\u5f15\u7528\u5730\u5740\u3002\u56e0\u6b64\uff0c\u5373\u4f7f b \u548c d \u7684\u503c\u76f8\u540c\uff0c\u4f46\u5b83\u4eec\u6307\u5411\u4e0d\u540c\u7684\u5f15\u7528\u5730\u5740\uff0c\u6240\u4ee5\u7528 &#8220;==&#8221; \u6bd4\u8f83\u7ed3\u679c\u4e3a false\u3002<\/p>\n<p><strong>integer vs. double<\/strong><\/p>\n<p>integer \u4e5f\u662f\u4e00\u4e2a\u5bf9\u8c61\uff0c\u4f46\u662f\u5b83\u662f\u4e00\u4e2a\u4e0d\u53ef\u53d8\u7684\u5305\u88c5\u7c7b\uff0c\u8fd9\u610f\u5473\u7740\u5b83\u4e0d\u80fd\u6539\u53d8\u5176\u503c\u3002\u5f53 b \u548c e \u6bd4\u8f83\u65f6\uff0c\u7f16\u8bd1\u5668\u4f1a\u81ea\u52a8\u5c06 e \u8f6c\u6362\u4e3a double\uff0c\u4f46\u8fd9\u5c06\u5bfc\u81f4\uff0c\u56e0\u4e3a double \u65e0\u6cd5\u8f6c\u6362\u4e3a integer\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fint\u3001Integer\u3001double\u3001Double \u6bd4\u8f83\u89c4\u5219\u8be6\u89e3\uff1a\u4e3a\u4ec0\u4e48\u201c==\u201d \u6bd4\u8f83\u65f6 a, c \u4e0e\u5176\u4ed6\u53c2\u6570\u4e3a\u771f\uff0c\u800c b \u4e0e d \u4e3a\u5047\uff0cb \u4e0e e \u7f16\u8bd1\u51fa\u9519\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>int\u3001integer\u3001double\u3001double \u6bd4\u8f83\u89c4\u5219\u8be6\u89e3 \u95ee\u9898\uff1a \u7ed9\u5b9a\u4ee5\u4e0b\u4ee3\u7801\uff1a int a = 10; Double b = 10.0; double c = 10; Double d = 10.0; Integer e = 10; \u767b\u5f55\u540e\u590d\u5236 \u4e3a\u4ec0\u4e48 a, c \u4e0e\u5176\u4ed6\u53c2\u6570\u7528 &#8220;==&#8221; \u6bd4\u8f83\u65f6\u90fd\u662f true\uff0c\u4f46\u662f b \u4e0e d \u7528 &#8220;==&#8221; \u6bd4\u8f83\u65f6\u4e3a false\uff0c\u800c b \u4e0e e \u7528 &#8220;==&#8221; \u6bd4\u8f83\u7f16\u8bd1\u51fa\u9519\uff1f \u56de\u7b54\uff1a int vs. double int \u662f\u4e00\u4e2a\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff0c\u800c double \u662f\u4e00\u4e2a\u5bf9\u8c61\u3002\u5f53 int \u548c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-35828","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/35828","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=35828"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/35828\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=35828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=35828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=35828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}