@@ -480,42 +480,34 @@ contributors: Eemeli Aro
480
480
1. Let _primValue_ be ? ToPrimitive(_value_, ~number~).
481
481
1. If _primValue_ is a BigInt, return <del>β(_primValue_)</del><ins>the Record { [[Value]]: β(_primValue_), [[StringDigits]]: 0 }</ins>.
482
482
1. If _primValue_ is a String, then
483
- 1. <del>Let _str_ be _primValue_.</del>
484
- 1. <ins>Let _text_ be StringToCodePoints(_primValue_).</ins>
485
- 1. <ins>Let _literal_ be ParseText(_text_, |StringNumericLiteral|).</ins>
486
- 1. <ins>If _literal_ is a List of errors, return the Record { [[Value]]: ~not-a-number~, [[StringDigits]]: 0 }.</ins>
487
- 1. <ins>Let _parseRes_ be the StringIntlMV of _literal_.</ins>
488
- 1. <ins>Let _x_ be the first element of _parseRes_.</ins>
489
- 1. <ins>Let _stringDigits_ be the second element of _parseRes_.</ins>
490
- 1. <ins>If _x_ is a mathematical value, then</ins>
491
- 1. <ins>Let _rounded_ be RoundMVResult(abs(_x_)).</ins>
492
- 1. <ins>If _rounded_ is *+β*<sub>π½</sub>, then</ins>
493
- 1. <ins>If _x_ < 0, set _x_ to ~negative-infinity~.</ins>
494
- 1. <ins>Else, set _x_ to ~positive-infinity~.</ins>
495
- 1. <ins>Set _stringDigits_ to 0.</ins>
496
- 1. <ins>If _rounded_ is *+0*<sub>π½</sub> and _x_ < 0, set _x_ to ~negative-zero~.</ins>
497
- 1. <ins>Return the Record { [[Value]]: _x_, [[StringDigits]]: _stringDigits_ }.</ins>
483
+ 1. Let _str_ be _primValue_.
498
484
1. Else,
499
- 1. <del>Let _x_ be ? ToNumber(_primValue_).</del>
500
- 1. <del>If _x_ is *-0*<sub>π½</sub>, return ~negative-zero~.</del>
501
- 1. <del>Let _str_ be Number::toString(_x_, 10).</del>
502
- 1. <ins>Let _n_ be ? ToNumber(_primValue_).</ins>
503
- 1. <ins>If _n_ is *NaN*, let _x_ be ~not-a-number~.</ins>
504
- 1. <ins>Else if _n_ is *+β*<sub>π½</sub>, let _x_ be ~positive-infinity~.</ins>
505
- 1. <ins>Else if _n_ is *-β*<sub>π½</sub>, let _x_ be ~negative-infinity~.</ins>
506
- 1. <ins>Else, let _x_ be β(_n_).</ins>
507
- 1. <ins>Return the Record { [[Value]]: _x_, [[StringDigits]]: 0 }.</ins>
508
- 1. <del>Let _text_ be StringToCodePoints(_str_).</del>
509
- 1. <del>Let _literal_ be ParseText(_text_, |StringNumericLiteral|).</del>
510
- 1. <del>If _literal_ is a List of errors, return ~not-a-number~.</del>
511
- 1. <del>Let _intlMV_ be the StringIntlMV of _literal_.</del>
512
- 1. <del>If _intlMV_ is a mathematical value, then</del>
513
- 1. <del>Let _rounded_ be RoundMVResult(abs(_intlMV_)).</del>
485
+ 1. Let _x_ be ? ToNumber(_primValue_).
486
+ 1. If _x_ is *-0*<sub>π½</sub>, return <del>~negative-zero~</del><ins>the Record { [[Value]]: ~negative-zero~, [[StringDigits]]: 0 }</ins>.
487
+ 1. Let _str_ be Number::toString(_x_, 10).
488
+ 1. Let _text_ be StringToCodePoints(_str_).
489
+ 1. Let _literal_ be ParseText(_text_, |StringNumericLiteral|).
490
+ 1. If _literal_ is a List of errors, return <del>~not-a-number~</del><ins>the Record { [[Value]]: ~not-a-number~, [[StringDigits]]: 0 }</ins>.
491
+ 1. Let <del>_intlMV_</del><ins>_parseRes_</ins> be the StringIntlMV of _literal_.
492
+ 1. <ins>Let _intlMV_ be the first element of _parseRes_.</ins>
493
+ 1. <ins>If _primValue_ is a String, then</ins>
494
+ 1. <ins>Let _stringDigits_ be the second element of _parseRes_.</ins>
495
+ 1. <ins>Else,</ins>
496
+ 1. <ins>Let _stringDigits_ be 0.</ins>
497
+ 1. If _intlMV_ is a mathematical value, then
498
+ 1. Let _rounded_ be RoundMVResult(abs(_intlMV_)).
514
499
1. <del>If _rounded_ is *+β*<sub>π½</sub> and _intlMV_ < 0, return ~negative-infinity~.</del>
515
500
1. <del>If _rounded_ is *+β*<sub>π½</sub>, return ~positive-infinity~.</del>
501
+ 1. <ins>If _rounded_ is *+β*<sub>π½</sub>, then</ins>
502
+ 1. <ins>If _intlMV_ < 0, set _intlMV_ to ~negative-infinity~.</ins>
503
+ 1. <ins>Else, set _intlMV_ to ~positive-infinity~.</ins>
504
+ 1. <ins>Set _stringDigits_ to 0.</ins>
516
505
1. <del>If _rounded_ is *+0*<sub>π½</sub> and _intlMV_ < 0, return ~negative-zero~.</del>
517
506
1. <del>If _rounded_ is *+0*<sub>π½</sub>, return 0.</del>
518
- 1. <del>Return _intlMV_.</del>
507
+ 1. <ins>If _rounded_ is *+0*<sub>π½</sub>, then</ins>
508
+ 1. <ins>If _intlMV_ < 0, set _intlMV_ to ~negative-zero~.</ins>
509
+ 1. <ins>Else, set _intlMV_ to 0.</ins>
510
+ 1. Return <del>_intlMV_</del><ins>the Record { [[Value]]: _intlMV_, [[StringDigits]]: _stringDigits_ }</ins>.
519
511
</emu-alg>
520
512
</emu-clause>
521
513
0 commit comments