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

stillwater-sc / universal / 34804083223
86%
master: 84%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 14 Sep 2026 04:31AM UTC
Jobs 1
Files 667
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

14 Sep 2026 03:52AM UTC coverage: 85.805% (+0.08%) from 85.729%
34804083223

push

github

web-flow
fix(integer): WholeNumber and NaturalNumber have no sign bit (#1495)

integer<>::sign() returned the raw MSB for all three IntegerNumberType values, and
several places read it as a sign. Every WholeNumber and NaturalNumber value in the upper
half of the range therefore went wrong: to_string(200) was "-56" (#1410), 200 >> 1 was
228, scale(200) was 5, and hex output refused the value as negative. Long division
shifts its divisor with >>=, so it failed as well.

Two more defects gave the same symptoms and are fixed here too:
- The one-block /= and %= fast path cast both operands to a signed native type whatever
  the number type, so integer<8, uint8_t, WholeNumber> 200 / 3 was 238 and 200 % 3
  was 254.
- The unsigned operator< returned early only when a block of lhs was smaller. When one
  was larger it moved on to the next block, so for integer<16, uint8_t> both 512 < 261
  and 512 > 261 were true. >, <= and >= delegate to it, and so does long division:
  40000 / 3 was 0.

The fix is at the root. sign() returns false for WholeNumber and NaturalNumber, as
isneg() already did and as the comment in reduce() assumed. The fast path divides
unsigned operands natively, and operator< returns at the first block that differs.
normalize() no longer needs its own guard around sign(). IntegerNumber is unchanged.

The new static/integer/binary/arithmetic/number_types.cpp checks all three number types
against native 64-bit arithmetic: sign(), isneg(), to_string, operator<< in decimal
and hex, the parse round trip, >>, scale(), widening, / and %, and the relational
operators. Level 1 is exhaustive over every operand and pair of integer<8, uint8_t> and
integer<10, uint8_t>, and samples 16, 32 and 64 bits with 8- to 64-bit blocks, drawing
operands from both halves of the range.

Verification:
- On main the test reports 5,549,292 wrong results at level 1, all WholeNumber or
  NaturalNumber (IntegerNumber: 0): 2.1M in >>, 1.6M in the relational operators, 1.4M
  in / and ... (continued)

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

4 existing lines in 1 file now uncovered.

43686 of 50913 relevant lines covered (85.81%)

7679228.8 hits per line

Coverage Regressions

Lines Coverage ∆ File
4
92.63
1.97% include/sw/universal/number/integer/integer_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 34804083223.1 14 Sep 2026 04:31AM UTC 667
85.81
GitHub Action Run
Source Files on build 34804083223
  • Tree
  • List 667
  • Changed 5
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #34804083223
  • bced1856 on github
  • Prev Build on main (#34794035930)
  • Next Build on main (#34819345064)
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