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

stillwater-sc / universal / 29750128328
85%
master: 84%

Build:
Build:
LAST BUILD BRANCH: losborn_bugfix_elreal_subnormal_blocks_aug26
DEFAULT BRANCH: master
Ran 20 Jul 2026 03:05PM UTC
Jobs 1
Files 700
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

20 Jul 2026 02:19PM UTC coverage: 84.781% (+0.02%) from 84.759%
29750128328

push

github

web-flow
feat(math): add fma, scalbn, logb, ilogb to efloat and ereal (#1171)

* feat(efloat+ereal): add fma, scalbn, logb, ilogb (both oracles)

The last <cmath> functions missing from both adaptive-precision types, added to
each type's numerics.hpp on native arithmetic:

- scalbn(x, n) = x * 2^n -- delegates to ldexp (exact binary-exponent shift).
- logb(x)  = floor(log2(|x|)) as a float; ilogb(x) = same as int with the
  <cmath> special values (ilogb(0)=FP_ILOGB0, ilogb(inf)=INT_MAX,
  ilogb(nan)=FP_ILOGBNAN; logb(0)=-inf, logb(inf)=+inf, logb(nan)=nan).
  * efloat: exact from scale() (the leading-bit exponent).
  * ereal: from the leading component's std::ilogb, corrected by +/-1 against the
    full magnitude (lower components can pull |x| across a power-of-two boundary).
- fma(x, y, z) = x*y + z. Both types multiply exactly at their working precision,
  so no intermediate rounding is introduced; 0*inf yields NaN through the type's
  own multiply, matching IEEE.

Verified against std:: on gcc and clang for both types, including logb binade
boundaries and the ilogb/logb special values. Tests added to the existing
efloat/ereal numerics suites; ereal mathlib.hpp location note updated.
cppcheck-clean.

Resolves #1166
Relates to #582

* test(math): make fma checks non-tautological + drop C compound literals (CodeRabbit #1171)

- fma tests compared fma(a,b,c) against a*b+c -- the same expression, so they
  could not detect intermediate rounding. Now verify exactness against an
  independently built value: (2^30+1)*(2^30-1) = 2^60-1, which is exact in the
  oracle but rounds to 2^60 in double, with the expected 2^60-1 constructed via
  scalbn/subtract (not the multiply). A rounding fma would fail. (efloat + ereal)
- ereal test used C99 compound literals `(const double[]){...}` (a GCC/Clang
  extension, ill-formed ISO C++); replaced by the direct construction above.
- ereal/mathlib.hpp remaining-work tracker no longer lists the now-implemented
  #1165/#1166 <cmat... (continued)

43 of 49 new or added lines in 2 files covered. (87.76%)

7 existing lines in 3 files now uncovered.

49845 of 58793 relevant lines covered (84.78%)

7013644.86 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
91.3
-8.7% include/sw/universal/number/efloat/math/numerics.hpp
2
90.48
0.0% include/sw/universal/number/ereal/math/functions/numerics.hpp

Coverage Regressions

Lines Coverage ∆ File
5
50.45
-4.5% include/sw/universal/verification/posit_test_suite_randoms.hpp
1
80.58
-0.22% include/sw/universal/number/posit1/specialized/posit_16_1.hpp
1
90.06
-0.28% include/sw/universal/number/posito/posito_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 29750128328.1 20 Jul 2026 03:05PM UTC 700
84.78
GitHub Action Run
Source Files on build 29750128328
  • Tree
  • List 700
  • Changed 9
  • Source Changed 3
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #29750128328
  • 91936242 on github
  • Prev Build on main (#29741065847)
  • Next Build on main (#29751189839)
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