In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article, the editor introduces "how to express javascript numbers" in detail, the content is detailed, the steps are clear, and the details are handled properly. I hope this "how to express javascript numbers" article can help you solve your doubts.
Javascript numbers are represented in 64-bit floating-point format. In javascript, numbers are not divided into integer type and floating-point type, all numbers are floating-point type, are uniformly displayed as Number type, and are represented by 64-bit floating-point format defined by IEEE754 standard; the minimum value that can be expressed is "±5e-324".
The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.
Javascript numbers are represented in 64-bit floating-point format.
Unlike many other programming languages, JavaScript does not define different types of numbers, such as integers, short, long, floating point, and so on. JavaScript has only one numeric type.
In JavaScript, numbers are not divided into integer types and floating-point types. All numbers are floating-point types, which are represented by the Number type. JavaScript represents numbers in a 64-bit floating-point format defined by the IEEE754 standard. It can show that the maximum value (Number.MAX_VALUE) is ±1.7976931348623157e+308 and the minimum value (Number.MIN_VALUE) is ±5e-324.
This format stores values in 64 bits, where 0 to 51 store numbers (fragments), 52 to 62 store indices, and 63 bits store symbols:
Aka Fraction/Mantissa Index (Exponent) symbol (Sign) 52 bits (0-51) 11 bits (52-62) 1 bit (63)
There are also some special values in the Number type, which are Infinity,-Infinity, and NaN, where
Infinity: a number used to represent positive infinity, usually a number greater than 1.7976931348623157e+308
-Infinity: used to represent a negative infinity, usually a number less than 5e-324
NaN: non-numeric (abbreviation for Not a Number), used to represent invalid or undefined mathematical operations, such as 0 divided by 0.
Tip: if the result of a calculation is out of the range of Number type in JavaScript, the number will be automatically converted to infinity, with positive number Infinity and negative number-Infinity.
Precision.
Integers (without decimal or exponential counting) are up to 15 digits.
Var x = 9999999999999999; / x is 999999999999999var y = 9999999999999999; / / y is 100000000000000
The maximum number of decimal places is 17, but floating-point operations are not always 100% accurate:
Var x = 0.2cm 0.1; / / the output result is 0.30000000000000004. Here, the article "how to represent javascript numbers" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.