2 ms·
> This is discussed in the article. The standard is to use infinity, not zero. It's wrong. How is infinity returned as a result anyway? It's not a number, and
by foobar1962 2y ago
> This is discussed in the article. The standard is to use infinity, not zero.
It's wrong.
How is infinity returned as a result anyway? It's not a number, and it's not <the largest number the computer can return> either.
- ikekkdcjkfke 2y agoNo idea but in javascript Infinity is a type of constant i guess, any subsequent operations on Infinity just returns infinity instead of crashing
- recursive 2y agoInfinities have representation in many computer number systems, such as IEE-754 floating point, which is the number system used by Javascript.
- 8organicbits 2y agoLots of programming languages use this standard. It's helpful to know. https://www.gnu.org/software/libc/manual/html_node/Infinity-and-NaN.html https://www.gnu.org/software/libc/manual/html_node/Infinity-...