Nnmber type in ecmascript

Source: Internet
Author: User

The nnmber type in ecmascript is special. This type can be a 32-bit integer or a 64-bit floating point number. Any number directly entered is treated as a number literal. For example:

 

VaR inum = 44;

VaR inum = 070;

VaR inum = 0xab;

VaR inum = 0x1f;

 

An integer can also be expressed as octal or hexadecimal.

 

VaR fnum = 55;

 

VaR fnum = 3.125e7

 

A very large or very small number can also be expressed by scientific notation.

 

A special value indicates infinity, that is, infinity.

 

Number. The value of positive_infinity is infinity;

 

Number. The value of negative_infinity is-infinity;

 

There is also a special value Nan, which indicates a non-a number. Nan is a strange special value, and it is not equal to itself.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.