Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefer else-ifs #10

Merged
merged 2 commits into from
Apr 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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