File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -980,9 +980,10 @@ lexer_parse_number (void)
980980 const lit_utf8_byte_t *fp_buf_p = TOK_START ();
981981 /* token is constructed at end of function */
982982
983- for (i = 0 ; i < tok_length; i++)
983+ ecma_number_t mult = 1 .0f ;
984+ for (i = tok_length; i > 0 ; i--, mult *= 10 )
984985 {
985- fp_res = fp_res * 10 + (ecma_number_t ) lit_char_hex_to_int (fp_buf_p[i]) ;
986+ fp_res += (ecma_number_t ) lit_char_hex_to_int (fp_buf_p[i - 1 ]) * mult ;
986987 }
987988 }
988989 }
Original file line number Diff line number Diff line change @@ -22,3 +22,5 @@ assert(big == 2147483648); // overflow on 32bit numbers
2222
2323big ++ ;
2424assert ( big == 2147483649 ) ; // overflow on 32bit numbers
25+
26+ assert ( ( 1152921504606846900 ) . toString ( ) === "1152921504606847000" )
You can’t perform that action at this time.
0 commit comments