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

uber / h3 / 42867537472
100%

Build:
DEFAULT BRANCH: master
Ran 10 Nov 2026 05:46PM UTC
Jobs 1
Files 24
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

10 Nov 2026 05:41PM UTC coverage: 99.758%. Remained the same
42867537472

push

github

web-flow
fix(latLng): clamp haversine term to avoid NaN for antipodal points (#1297)

* fix(latLng): clamp haversine term to avoid NaN for antipodal points

greatCircleDistanceRads computes A = sin^2(dLat/2) + cos(latA)*cos(latB)*sin^2(dLng/2),
which is mathematically bounded to [0, 1], then calls sqrt(1 - A). For
near-antipodal and antipodal inputs (e.g. 12N,0 / 12S,180), floating-point
rounding pushes A fractionally above 1, making sqrt(1 - A) NaN and
propagating through the Km/M wrappers.

Clamp A to [0, 1] before the sqrt calls. The lower bound is defensive: A is
a sum of a square and a product of two cosines (each non-negative for
latitudes in [-90, 90] degrees) and a square, so it cannot go negative in
practice, but clamping both ends is the standard fix for this class of
floating-point domain error and costs nothing.

Adds a regression test (distanceRads_antipodal) covering the reported
near-antipodal case plus equatorial and pole-to-pole antipodes.

Fixes #1261

* fix(latLng): address review feedback on antipodal distance fix

- Wrap the now-unreachable A < 0 defensive branch in NEVER(), per
  justinhwang's review comment, matching the pattern already used
  elsewhere in this codebase for provably-unreachable defensive checks.
- Add a near-antipodal regression case (CodeRabbit nitpick): a point
  179.9999 degrees away must resolve to its actual angle, not pi,
  guarding against an overly broad clamp.
- CodeRabbit's suggestion to extract the clamp into a separately-testable
  helper was not taken, since it is a larger structural change than this
  fix's scope and this file has no existing precedent for test-only
  internal helpers.

* fix(latLng): revert NEVER() on the A < 0 branch, it is fuzzer-reachable

greatCircleDistanceRads is a public API with no enforced precondition
that lat/lng are valid angles. The CI fuzzer corpus (fuzzerDistances,
LibFuzzer and oss-fuzz jobs) drives A negative with out-of-range
inputs, which under NEVER()'s debug-build asse... (continued)

1941 of 1951 branches covered (99.49%)

Branch coverage included in aggregate %.

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

3428 of 3431 relevant lines covered (99.91%)

36826962.1 hits per line

Jobs
ID Job ID Ran Files Coverage
1 42867537472.1 10 Nov 2026 05:46PM UTC 24
99.76
GitHub Action Run
Source Files on build 42867537472
  • Tree
  • List 24
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 3065dfcc on github
  • Prev Build on master (#42681295527)
  • Next Build on master (#42874253317)
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