It fails after 20 digit integer number with radix 10.
You may have a look to the description of parseInt:
Because some numbers include the e character in their string representation (e.g. 6.022e23), using parseInt to truncate numeric values will produce unexpected results when used on very large or very small numbers. parseInt should not be used as a substitute for Math.floor().
From the standard ECMA 252 V 5.1 15.1.2.2
parseInt (string , radix)
Step 13:
Let mathInt be the mathematical integer value that is represented by Z in radix-R notation, using the letters A-Z and a-z for digits with values 10 through 35. (However, if R is 10 and Z contains more than 20 significant digits, every significant digit after the 20th may be replaced by a 0 digit, at the option of the implementation; and if R is not 2, 4, 8, 10, 16, or 32, then mathInt may be an implementation-dependent approximation to the mathematical integer value that is represented by Z in radix-R notation.)
...
NOTE
parseInt may interpret only a leading portion of string as an integer value; it ignores any characters that cannot be interpreted as part of the notation of an integer, and no indication is given that any such characters were ignored.
var x = 5.7 * 1e20;
console.log(x);
console.log(parseInt(x, 10));
x = 5.7 * 1e21;
console.log(x);
console.log(parseInt(x, 10));
4.7 * 1e22is already an integer. Why are you parsing that as an integer again?parseIntconverts the first argument into a string (because it expects one) and parses that as an integer again. The actual result of4.7 * 1e22is4.7e+22.