Numeric literal (Primitive value)

A literal constant whose type is a built-in primitive value.

Availability:

ECMAScript edition - 2
Property/method value type:Number primitive

Numeric literals are constant numeric values expressed in Decimal, Hexadecimal or Octal notation.

Numeric values can be integer or floating point.

Floating point values can be specified with exponential notation.

Hexadecimal values must always be integers, thus:

Octal values must always be integers, must start with a zero and contain only the characters 0-7.

The standard does not mandate any particular rounding technique but recommends the use of IEEE 754 standard numeric computation. This standard has been in existence for some time now and is likely to be the foundation numeric computation standard in most platforms.

See also:Floating constant, Implicit conversion, Literal, Number formats (.)

Cross-references:

ECMA 262 edition 2 - section - 7.7.3

ECMA 262 edition 3 - section - 7.8.3