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

stillwater-sc / universal / 36078890541
87%
master: 84%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 25 Sep 2026 01:15AM UTC
Jobs 1
Files 676
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

25 Sep 2026 12:44AM UTC coverage: 85.992% (+0.02%) from 85.972%
36078890541

push

github

web-flow
fix(cfloat): compute digits10 and max_digits10 from the standard formulas (#1600)

* fix(cfloat): compute digits10 and max_digits10 from the standard formulas

numeric_limits<cfloat>::digits10 was static_cast<int>(digits / 3.3f) and
max_digits10 was digits10 + 1. 3.3 stands in for 1/log10(2) = 3.3219, and
max_digits10 is not digits10 + 1 in general, so both drifted:

  type               digits10 was/now   max_digits10 was/now
  half  (binary16)        3 / 3               4 / 5
  single(binary32)        7 / 6               8 / 9
  duble (binary64)       16 / 15             17 / 17
  quad  (binary128)      34 / 33             35 / 36
  octo  (binary256)      71 / 71             72 / 73

The aliases exist so a caller can reach for a known IEEE format instead of
hand-articulating a cfloat<>, and a drop-in that disagrees with the type it
mirrors defeats that: single reported 7 decimal digits where native float
reports 6. Over-reporting digits10 is the unsafe direction, since it is the
round-trip-INTO guarantee -- code sizing a buffer or a setprecision from it
claimed a digit the format cannot hold. Under-reporting max_digits10 breaks
round-tripping OUT, which is the classic float 9-digit case.

decimal_digits.hpp computes both exactly in integer arithmetic, so they stay
usable in a constexpr initialiser. log10(2) is carried as the rational
30102999566/100000000000 rather than the obvious 30103/100000, which was
measured to break at digits=13301 -- inside the range elreal reaches. The
chosen ratio reproduces the exactly-rounded result to digits=325146 and its
largest product stays in int64_t to digits=306 million.

The helper is deliberately shared rather than inlined here: eleven other number
systems carry the same digits/3.3 expression and can adopt it, though integer
and fixed-point types need their own formula rather than the floating-point one.

The suite hand-computes its reference values from the standard definitions
instead of recomputing them with... (continued)

45514 of 52928 relevant lines covered (85.99%)

9412835.71 hits per line

Jobs
ID Job ID Ran Files Coverage
1 36078890541.1 25 Sep 2026 01:15AM UTC 676
85.99
GitHub Action Run
Source Files on build 36078890541
  • Tree
  • List 676
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #36078890541
  • 8d17997f on github
  • Prev Build on main (#36050659414)
  • Next Build on main (#36096227751)
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