为什么无穷大/无穷大不是 1?
如果
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
请注意您对无穷大的算术行为所做的任何假设。
如果 ∞/∞ = 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.)
因为 规范 是这样说的:
我不是数学家,
但即使从这个角度来看,得到(编辑:正如我所说,我不是数学家;))。1
结果也是没有意义的。无穷大可以不同,仅仅因为它们在 JavaScript 中相等并不能证明在所有其他情况下将它们视为相等(或者让除法返回1
)。Because the specification says so:
I'm not a mathematician,
but even from that point of view, having(edit: as I said, I'm not a mathematician ;)).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 return1
for that matter).结果在数学上是不确定的。它与javascript无关。请参阅以下说明。
The result is mathematically undefined. It has nothing to do with javascript. See the following explanation.
从微积分一就可以认出来!这是一个不定式!
It's recognizable from Calculus one! It's a indeterminate form!