JavaScript Basic Learning-javascript authoritative guide--3.1 numbers

Source: Internet
Author: User

Digital

JavaScript does not distinguish between integers and floating-point numbers, all of which are floating-point number.

The opposite number is obtained by adding the minus sign before the number.

3.1.1 Plastic Direct Volume

Hex: 0X or 0x

Do not mark: decimal

Octal: 0

Note: A write JavaScript supports octal.

3.1.2 Floating-point Direct volume

1.2E-3 = 1.2 * 10 Negative 3 times

3.1.3 Arithmetic operations

Overflow: The result of the operation is more than the result of the number can be expressed, overflow and underflow.

Underflow: The result of the operation is infinitely close to 0.

0 do divisor: The result is infinity or negative infinity.

0/0 NaN
Infinity/Infinity NaN
Negative root NaN
is not a number or an operation that cannot be converted into a number NaN

Positive 0 and minus 0, except to do the divisor result is not the same, the others are the same

3.1.4 Binary floating-point numbers and rounding

Binary floating-point notation cannot accurately represent 0.1 of such numbers.

3.1.5 Date and time
var New Date (2012,12,1); var New  var elp = now- then;console.log (ELP);//82671145445 interval of milliseconds 


varNew Date (2011,12,3,12,23,56);
Console.log (that.getfullyear); Console.log (That.getmonth); Console.log (That.getdate ()); Console.log (That.getday () ); Console.log (That.gethours ()); Console.log (getUTCHours ());//Do not know why 360 does not have this, referenceerror:getutchours is not Defined

JavaScript Basic Learning-javascript authoritative guide--3.1 numbers

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.