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

moonbitlang / core / 6903
89%

Build:
DEFAULT BRANCH: main
Ran 05 Oct 2026 12:38PM UTC
Jobs 1
Files 454
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

05 Oct 2026 12:34PM UTC coverage: 89.441% (-0.001%) from 89.442%
6903

push

github

bobzhang
fix(math): evaluate log2 in hi/lo parts on non-JS targets

`log2(x)` was `ln(f) / LN2 + e`: a division by a rounded constant and an
addition on top of `ln`'s own error, up to 1.9 ulp off. Port the tail of
FreeBSD's e_log2.c (the algorithm of musl <= 1.1.21 and of Rust's `libm`)
instead: keep log(1+f) as a hi + lo pair, multiply by a two-part 1/ln2 and
add the exponent with the rounding error carried along.

On 72,799 positive finite inputs against an 80-digit reference: correctly
rounded 80.59% -> 97.97%, max error 1.903 -> 0.729 ulp, results off by more
than 1 ulp 2,182 -> 0. Results are bit-identical to a C build of the
reference on native, wasm and wasm-gc. It is also faster (one inlined
reduction instead of two `frexp` calls and a division): 8.3x on native and
2.7x on wasm-gc for 1,024 calls.

Part of #4336.

Reviewed by Codex CLI (xhigh): "Constants, operation order, bit helpers,
and integer ranges match the reference. Special-value result categories
are preserved."

Signed-off-by: Codex CLI <codex@openai.com>

12 of 12 new or added lines in 1 file covered. (100.0%)

1 existing line in 1 file now uncovered.

16696 of 18667 relevant lines covered (89.44%)

336823.34 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
94.12
-5.88% math/utils.mbt
Jobs
ID Job ID Ran Files Coverage
1 6903.1 05 Oct 2026 12:38PM UTC 454
89.44
GitHub Action Run
Source Files on build 6903
  • Tree
  • List 454
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 165f51fc on github
  • Prev Build on main (#6896)
  • Next Build on main (#6905)
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