为什么无穷大/无穷大不是 1?

发布于 2024-12-04 20:02:44 字数 227 浏览 1 评论 0原文

如果

Infinity === Infinity
>> true

那么

typeOf Infinity
>> "number"

为什么是

Infinity / Infinity
>>NaN

而不是1?

If

Infinity === Infinity
>> true

and

typeOf Infinity
>> "number"

then why is

Infinity / Infinity
>>NaN

and not 1?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

撕心裂肺的伤痛 2024-12-11 20:02:44

请注意您对无穷大的算术行为所做的任何假设。

如果 ∞/∞ = 1,则 1×∞ = ∞。推而广之,既然 2×∞ = ∞,那么 ∞/∞ = 2 也一定是这样的情况。

由于它是在与另一个答案的讨论中提出的,我想指出方程 2×∞ = ∞ 确实并不意味着存在多个无穷大。所有可数无限集都具有相同的基数。即,整数集合与奇数集合具有相同的基数,即使第二集合缺少第一集合的一半元素。 (OTOH,还有其他类型的“无穷大”,例如实数集的基数,但是将可数无穷大加倍不会产生其中的一种。就此而言,对其进行平方也不会产生.)

Beware any assumptions you make about the arithmetic behaviour of infinity.

If ∞/∞ = 1, then 1×∞ = ∞. By extension, since 2×∞ = ∞, it must also be the case that ∞/∞ = 2.

Since it has come up in discussion against another answer, I'd like to point out that the equation 2×∞ = ∞ does not imply that there are multiple infinities. All countably infinite sets have the same cardinality. I.e., the set of integers has the same cardinality as the set of odd numbers, even though the second set is missing half the elements from the first set. (OTOH, there are other kinds of "infinity", such as the cardinality of the set of reals, but doubling the countable infinity doesn't produce one of these. Nor does squaring it, for that matter.)

巨坚强 2024-12-11 20:02:44

因为 规范 是这样说的:

无穷大除以无穷大会得到 NaN

我不是数学家,但即使从这个角度来看,得到 1 结果也是没有意义的。无穷大可以不同,仅仅因为它们在 JavaScript 中相等并不能证明在所有其他情况下将它们视为相等(或者让除法返回 1)。 (编辑:正如我所说,我不是数学家;))。

Because the specification says so:

Division of an infinity by an infinity results in NaN.

I'm not a mathematician, but even from that point of view, having 1 as result it does not make sense. Infinities can be different and only because they are equal in JavaScript does not justify treating them as equal in all other cases (or letting the division return 1 for that matter). (edit: as I said, I'm not a mathematician ;)).

洛阳烟雨空心柳 2024-12-11 20:02:44

结果在数学上是不确定的。它与javascript无关。请参阅以下说明

The result is mathematically undefined. It has nothing to do with javascript. See the following explanation.

青萝楚歌 2024-12-11 20:02:44

从微积分一就可以认出来!这是一个不定式!

It's recognizable from Calculus one! It's a indeterminate form!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文