TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

JS WTF with Math

4 点作者 avastmick超过 7 年前

1 comment

Gibbon1超过 7 年前
&gt; 0.1 + 0.2 == 0.3 &#x2F;&#x2F; false<p>&gt; This is not a problem of JS to be fair. This is floating point math.<p>This is binary floating point math, which shouldn&#x27;t be the default in a language like JS. And in any event it&#x27;s a design flaw for a language to blithely convert 0.2 which is decimal floating point to binary floating point without being asked.