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

moonbitlang / core / 6905
89%

Build:
DEFAULT BRANCH: main
Ran 05 Oct 2026 01:57PM UTC
Jobs 1
Files 454
Run time 2min
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 01:55PM UTC coverage: 89.442% (+0.001%) from 89.441%
6905

push

github

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

`log10(x)` scaled `ln(f)` by a single rounded 1/ln(10), up to 1.8 ulp off.
Port the tail of FreeBSD's e_log10.c (as in musl and Rust's `libm`)
instead: keep log(1+f) as a hi + lo pair, multiply by a two-part 1/ln10
and add k*log10(2) with the rounding error carried along.

On 78,522 positive finite inputs against an 80-digit reference: correctly
rounded 83.76% -> 98.41%, max error 1.782 -> 0.680 ulp, results off by more
than 1 ulp 1,009 -> 0. Results are bit-identical to musl's log10.c on
native, wasm and wasm-gc, and log10(10^k) = k still holds for every
k = -311..308. It is also faster (one inlined reduction instead of `frexp`
twice): 5.6x on native and 2.5x on wasm-gc for 1,024 calls.

The digit-exact tests live in a new non-JS test file: on JS `log10` is the
engine's `Math.log10`, whose last digit is the engine's business. The V8
tested here (14.1, Node 25) still uses the older, less accurate formula,
so the two differ in the last digit on many inputs (`log10(11.0)` moves
there for that reason).

Part of #4336.

Reviewed by Codex CLI (xhigh): "The port matches both local references in
constants, arithmetic order, and bit manipulation. Subnormal scaling,
reduction boundaries, `+0` at one, and non-JS test gating check out."

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

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

16698 of 18669 relevant lines covered (89.44%)

344983.09 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6905.1 05 Oct 2026 01:57PM UTC 454
89.44
GitHub Action Run
Source Files on build 6905
  • Tree
  • List 454
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • d4f0a2d9 on github
  • Prev Build on main (#6903)
  • Next Build on main (#6907)
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