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

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

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 29 Jul 2026 02:11AM UTC
Jobs 1
Files 596
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

29 Jul 2026 01:36AM UTC coverage: 85.218% (+0.006%) from 85.212%
30414562427

push

github

web-flow
fix(interval): round arithmetic outward to restore the containment property (#1246)

* fix(interval): round arithmetic outward to restore the containment property

interval<Scalar> performed its arithmetic under round-to-nearest, so the computed
enclosure could be narrower than the true result range -- the Fundamental Theorem of
Interval Arithmetic (the only reason to use an interval type) silently failed. The
classic symptom: interval(0.1) * interval(0.1) returned a ZERO-width interval that did
not contain the exact product.

Fix (Stage 1 of #1234): round every inexact endpoint OUTWARD -- lower bound toward
-inf, upper bound toward +inf -- via nextafter. nextafter is used rather than the FPU
rounding mode (fesetround) because it is Scalar-generic: the hardware rounding mode has
no effect on posit/cfloat/lns arithmetic, and interval<posit<...>> is a target use case.

Outward rounding applied to: operator+= -= *= /= (the reciprocal endpoints too), sqr(),
sqrt(), and rounded UP in width()/rad() so mid()+/-rad() covers. Constructors enclose a
value outward only when the conversion to Scalar is inexact (round-trip check), so
exactly-representable operands keep zero-width endpoints (interval<double>(2) stays [2,2])
while an inexact cross-type cast (interval<float>(0.1)) is enclosed. The value/range
constructors, rad() and width() are no longer constexpr (nextafter is a runtime op).
Free operators and scalar-mixed overloads inherit the fix (they delegate to members/ctors).
Unchanged (already exact): unary -, abs, intersect, hull, comparison/contains predicates.

Tests: the existing addition/subtraction/multiplication/division suites asserted EQUALITY
on small integer operands (vacuous -- no rounding ever occurred), so a widening fix makes
them fail by design; converted them to CONTAINMENT (expected result must be a subset of the
computed interval). New containment.cpp exercises inexact operands (0.1*0.1, 1/3, sqrt(2),
an 8-term sum, cross-type ctor), a rand... (continued)

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

41536 of 48741 relevant lines covered (85.22%)

7162173.23 hits per line

Jobs
ID Job ID Ran Files Coverage
1 30414562427.1 29 Jul 2026 02:11AM UTC 596
85.22
GitHub Action Run
Source Files on build 30414562427
  • Tree
  • List 596
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #30414562427
  • 643567e7 on github
  • Prev Build on main (#30409374645)
  • Next Build on main (#30445687464)
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