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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Array Ordering and Naive Summation

2 点作者 aw1621107超过 3 年前

1 comment

aw1621107超过 3 年前
Thought this was a fascinating example of the perils of naive floating-point summation. I knew that one had to be careful with floating-point math, but I had no idea that this kind of thing was possible:<p>&gt; The sumsto function always returns the same 2046 floating-point numbers but returns them in a different order based on x: for any 64-bit float value of x from 0 up to (but not including) 2^970, the naive left-to-right sum of the vector returned by sumsto(x) is precisely x
评论 #29211229 未加载