From cdb3c8b8811a6237eda97ed1349b9799f3340f70 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Fri, 5 Apr 2024 18:48:47 -0700 Subject: [PATCH] prefer else-ifs (#10) --- spec.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spec.html b/spec.html index 68919dc..9e5ec75 100644 --- a/spec.html +++ b/spec.html @@ -42,14 +42,15 @@

Math.sumExact ( _items_ )

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 *+∞*𝔽, then + 1. If _n_ is *NaN*, then + 1. Set _state_ to ~not-a-number~. + 1. Else if _n_ is *+∞*𝔽, then 1. If _state_ is ~minus-infinity~, set _state_ to ~not-a-number~. 1. Else, set _state_ to ~plus-infinity~. - 1. If _n_ is *-∞*𝔽, then + 1. Else if _n_ is *-∞*𝔽, 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*𝔽 and _state_ is either ~minus-zero~ or ~finite~, then + 1. Else if _n_ is not *-0*𝔽 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*.