浮点数真的很合理吗?
据说,浮点增加是可交值的,但不是关联的。
它是非关联的一个示例:
(1 + 1E100) + -1E100 = 0
和1 +(1E100 + -1E100)= 1
,
但dionn' t这也证明它们不会通过以下以下方式交换:
1 + 1E100 + -1E100 = 0
和1E100 + -1E100 + 1 = 1 = 1
It's said that floating point addition is commutative but not associative.
An example of it being non associative is the following:
(1 + 1e100) + -1e100 = 0
, and 1 + (1e100 + -1e100) = 1
But doesn't this also prove that they are not commutative by the following:
1 + 1e100 + -1e100 = 0
, and 1e100 + -1e100 + 1 = 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论