Home  >  Article  >  Web Front-end  >  What is negative infinity in JavaScript

What is negative infinity in JavaScript

青灯夜游
青灯夜游Original
2022-01-19 18:48:082573browse

In JavaScript, negative infinity refers to "-Infinity", which means a number smaller than any finite number (a numerical value of negative infinity). Generally, a value smaller than "-1.7976931348623157E 103088" is negative infinity. .

What is negative infinity in JavaScript

The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.

Infinity in JavaScript is a special number with interesting properties: it is larger than any finite number and is used to store values ​​representing positive infinity.

Negative infinity

And negative infinity refers to "-Infinity", which represents a numerical value of negative infinity.

In Javascript, the value exceeding 1.7976931348623157E 103088 is Infinity, and the value less than -1.7976931348623157E 103088 is negative infinity (-Infinity).

Let's -Infinity compare to some finite numbers:

What is negative infinity in JavaScript

Also, negative infinity is smaller than positive infinity:

What is negative infinity in JavaScript

When using operands with different signs, you may end up with negative infinity:

What is negative infinity in JavaScript

[Related recommendations: javascript Study tutorial

The above is the detailed content of What is negative infinity in JavaScript. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What is reverse ajaxNext article:What is reverse ajax