• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moonbitlang / core / 6883
89%

Build:
DEFAULT BRANCH: main
Ran 28 Sep 2026 07:51AM UTC
Jobs 1
Files 453
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Sep 2026 07:48AM UTC coverage: 89.439% (+0.01%) from 89.429%
6883

push

github

bobzhang
fix(range): compute Float/Double iter elements as from + k * step

@range.iter built each Float/Double element by adding step to the
previous one, so rounding error accumulated: 0.0 to 1.0 by 0.1 yielded
11 elements and inclusive=true never reached 1.0.

The sealed Step trait gains one hidden method, enumerate, the body of
iter. Its default is the old accumulating loop, so the integral types
keep exactly their previous code (and no element counter). Float and
Double override it with their own counter loop computing element k as
from + k * step (in Double, rounded for Float); the two loops differ
only in that line.

For Double, when k * step overflows although the element is finite
(from=-1e308, step=1e308 reaches 1e308 at k = 2), the element is
computed as (from * 0.5 + k * (step * 0.5)) * 2.0, which rounds exactly
like the unbounded-exponent from + k * step; a quickcheck pins this
against the same range scaled down by 2^-64. From element 2^53 on, where
the Double counter saturates, Double falls back to repeated addition.

The existing strict-progress check is unchanged, so the elements stay
strictly monotonic and a sub-precision step still stops.

Codex review (ultra, 4 rounds): round 1 found k * step overflow dropping
elements; round 2 found the prev + step overflow fallback carrying error
past `to`; round 3 approved; round 4 approved the refactor from two
hidden trait methods to one:
> Approved. The refactor preserves counter initialization and increment
> order, fallback and overflow behavior, and the old `prev` -> current `i`
> relationship. Bounds, inclusive checks, and progress logic match across
> the loops.

Signed-off-by: Codex CLI <codex@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

45 of 46 new or added lines in 1 file covered. (97.83%)

16683 of 18653 relevant lines covered (89.44%)

331852.54 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
98.98
-1.02% range/range.mbt
Jobs
ID Job ID Ran Files Coverage
1 6883.1 28 Sep 2026 07:51AM UTC 453
89.44
GitHub Action Run
Source Files on build 6883
  • Tree
  • List 453
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 90227c36 on github
  • Prev Build on main (#6882)
  • Next Build on main (#6885)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc