Why does JavaScript use the term "Number" as opposed to "Integer"?

Is "Number" in JavaScript completely synonymous with "Integer"?

What aroused my curiosity:

--- PHP, Python, Java and others use the term Integer, --- JavaScript has a function parseInt(), notparseNumber()

Are there any details of interest?

+4
source share
2 answers

Is "Number" in JavaScript completely synonymous with "Integer"?

No. All numbers in JavaScript are actually 64-bit floating point values.

parseInt()and parseFloat()both return the same data type - the only difference is whether any fractional part is truncated.

52 64 , 53- . .

-9007199254740992 +9007199254740992 (-2 ^ 53 + 2 ^ 53). , JavaScript , 9007199254740993. JavaScript 9007199254740992. 9007199254740994, 9007199254740996, 9007199254740998 .. , . , , , ( ), Number.MAX_VALUE == 1.7976931348623157e+308.

+9

All Articles