Skip to content

Commit

Permalink
prefer else-ifs (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra authored Apr 6, 2024
1 parent 6c9339e commit cdb3c8b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ <h1>Math.sumExact ( _items_ )</h1>
1. Return ? IteratorClose(_iteratorRecord_, _error_).
1. Let _n_ be _next_.
1. If _state_ is not ~not-a-number~, then
1. If _n_ is *NaN*, set _state_ to ~not-a-number~.
1. If _n_ is *+∞*<sub>𝔽</sub>, then
1. If _n_ is *NaN*, then
1. Set _state_ to ~not-a-number~.
1. Else if _n_ is *+∞*<sub>𝔽</sub>, then
1. If _state_ is ~minus-infinity~, set _state_ to ~not-a-number~.
1. Else, set _state_ to ~plus-infinity~.
1. If _n_ is *-∞*<sub>𝔽</sub>, then
1. Else if _n_ is *-∞*<sub>𝔽</sub>, then
1. If _state_ is ~plus-infinity~, set _state_ to ~not-a-number~.
1. Else, set _state_ to ~minus-infinity~.
1. If _n_ is not *-0*<sub>𝔽</sub> and _state_ is either ~minus-zero~ or ~finite~, then
1. Else if _n_ is not *-0*<sub>𝔽</sub> and _state_ is either ~minus-zero~ or ~finite~, then
1. Set _state_ to ~finite~.
1. Set _sum_ to _sum_ + ℝ(_n_).
1. If _state_ is ~not-a-number~, return *NaN*.
Expand Down

0 comments on commit cdb3c8b

Please sign in to comment.