Number Data Type
The number data type is a primitive data type and it is internally stored as a floating point
number, which is a 64 bit, double precision number. This 64 bit field stores the sign,
exponent and fraction. While the leftmost bit is reserved for sign, the bits 0 to 51 are
reserved for storing the fraction and bits 52-62 are used for the exponent.
Because of memory limitation on the system, 253 is the highest integer that can be stored.
It is important to note that integer calculations generate a precise value. However,
fractional data calculation may give imprecise results. Therefore, these values have to be
truncated.
In addition to numbers and strings, JavaScript also supports the use of the following
special characters.
undefined specifies that the value has not been assigned yet.
NaN stands for ‘Not a Number’
-Infinity any number that is less than -1.7976931348623157E + 10308 is denoted
by Infinity.
Infinity - any number that exceeds the value 1.7976931348623157E + 10308 is
denoted by Infinity.
Do'stlaringiz bilan baham: |