JS-数字类型
?Because of rounding error, the difference between the approximations of .3 and .2 is not exactly the same as the difference between the approximations of .2 and .1.It is important to understand that this problem is not specific to JavaScript:it affects any programming languages that uses binary floating-point numbers.
A future version of JavaScript may support a decimal numeric type that avoids these rounding issues.Until then you might want to perform critical financial calculations using scaled integers.For example, you might manipulate monetary values as integer cents rather than fractional dollars.
?
?Arithmetic:Javascript programs work with numbers using the arithmetic operators.In addition to these basic arithmetic operators, it supports more complex mathematical operations through a set of functions and constants defined as properties of Math object.For example:

Arithmetic in JavaScript doen not raise errors in cases of overflow, underflow, or division by zero.
Number.POSITIVE_INFINITYNumber.MAX_VALUENumber.NaNNumber.NEGATIVE_INFINITYNumber.MIN_VALUE//Infinity,-Infinity,NaN//console.log(isNaN(111))console.log(isNaN(NaN))console.log(isFinite(Number.POSITIVE_INFINITY))console.log(Number.POSITIVE_INFINITY == Infinity)?ECMAScript3,Infinity and NaN are read/write values and can be changed.ECMAScript5 corrects this and makes the values read-only.The Number object defines alternatives that are read-only even in ECMAScript3.?
?
?