What is negative infinity in JavaScript

青灯夜游
Release: 2022-01-19 18:48:08
Original
2618 people have browsed it

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!