!5128 BugFix:Number.parseFloat("10000000000000000000000.0") Get an error result

Merge pull request !5128 from 贺存茂/hcm1102
This commit is contained in:
openharmony_ci 2023-11-03 07:09:25 +00:00 committed by Gitee
commit 91b2dae3ca
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 5 additions and 0 deletions

View File

@ -664,6 +664,7 @@ double NumberHelper::StringToDouble(const uint8_t *start, const uint8_t *end, ui
}
// 8. parse '.'
exponent = 0;
if (radix == DECIMAL && *p == '.') {
RETURN_IF_CONVERSION_END(++p, end, (digits > 0 || (digits == 0 && leadingZero)) ?
(number * std::pow(radix, exponent)) : NAN_VALUE);

View File

@ -109,4 +109,7 @@ print(s)
print(Number.parseInt("4294967294"))
print(Number.parseInt("2147483648"))
print(Number.parseFloat("10000000000000000000000.0"));
print("builtins number end");

View File

@ -99,6 +99,7 @@ TypeError: Cannot convert a BigInt value to a number
0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034lmua2oev
4294967294
2147483648
1e+22
builtins number end
builtins regexp start
20210608_5V0J5lVh4xVNYx0AUE.jpg,.jpg