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

stillwater-sc / universal / 39099257224
89%
master: 84%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 18 Oct 2026 05:29AM UTC
Jobs 1
Files 752
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

18 Oct 2026 05:03AM UTC coverage: 87.36% (+0.03%) from 87.33%
39099257224

push

github

web-flow
fix(dfloat): sqrt is the correctly rounded decimal root (1731)

dfloat sqrt was dfloat(std::sqrt(double(a))) in both branches of a
DFLOAT_NATIVE_SQRT switch, one of them marked "TBD". The decimal value
went to binary, took a binary root, and came back to decimal. A double
holds about 15.9 decimal digits, so decimal64 and decimal128 lost their
trailing digits, and decimal32 was rounded twice.

dfloat::square_root computes the root in decimal. The value is S 10^q.
It is scaled by 10^t, with t >= 0 and q - t even, until S 10^t has
2 ndigits + 1 digits. Then sqrt(S 10^(q - t)) = sqrt(S 10^t) 10^((q - t)/2).
The floor root F of S 10^t comes from a restoring integer square root
in the double-width significand, exactly, and has ndigits + 1 digits or
more. round_and_pack rounds it once to ndigits, ties to even, with the
remainder as the sticky part, as division does. An exact root takes the
IEEE 754-2008 preferred exponent floor(q/2), so sqrt(144) is 12, not
12.00000. A zero-valued (non-canonical DPD) encoding returns itself.
The free sqrt settles the special values: NaN; +-0; a negative argument,
which throws dfloat_negative_sqrt_arg under the throw flag and otherwise
sets errno = EDOM and returns a quiet NaN (it used to print to
std::cerr); and +inf. The switch is removed.

static/float/dfloat/math/sqrt.cpp judges in integer<1024>: every value
unpacked to an integer significand times a power of ten, and the
squares of the midpoints to r's neighbours compared with a. A tie cannot
occur, since a midpoint's square ends in 25. It runs exhaustively over
dfloat<3,2> in BID and DPD, and samples decimal32, decimal64 (BID and
DPD) and decimal128 over their exponent ranges. It also checks the
special values and the preferred exponent. On the old headers decimal64
fails 1942 of 3000, decimal64 DPD 648 of 1000 and decimal128 500 of
500. decimal32 passed: 7 digits survive the trip through a double.

Relates to #1725

BEHAVIOUR-CHANGE: dfloat sqrt is now correctly rounde... (continued)

38 of 38 new or added lines in 2 files covered. (100.0%)

50965 of 58339 relevant lines covered (87.36%)

10540282.15 hits per line

Jobs
ID Job ID Ran Files Coverage
1 39099257224.1 18 Oct 2026 05:29AM UTC 752
87.36
GitHub Action Run
Source Files on build 39099257224
  • Tree
  • List 752
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #39099257224
  • d168c78d on github
  • Prev Build on main (#39099250958)
  • Next Build on main (#39100454297)
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