parseint in IE8 conversion returns unequal (parseint ("08") returns 0, etc. with 0 beginning with a number string greater than 7)

Source: Internet
Author: User

Describe

  parseint ("08") in the IE8 kernel returns 0, and the value returned by a number string that begins with 0 is greater than 7 is not equal

Workaround

  parseint When Radix is not specified, S is calculated in hexadecimal when starting with 0x, and S is calculated according to octal if it starts with 0 and the second bit is not X, because octal cannot have 8, 9 so the error returns 0.

Test effective effects

  parseint ("08", 10) ==8

parseint in IE8 conversion returns unequal (parseint ("08") returns 0, etc. with 0 beginning with a number string greater than 7)

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.