Whole file

geographiclib/geographiclib-python

The author described this change as Fix bug where a geodesic with lat1 = 0 and lat2 = nan was treated as equatorial (bug found 2021-07-26).. It counts as a record because the check below fails on the code as it stood at 62fe5d3a1 and passes on 08745ea35, with nothing else changed between the two runs.

Fix saved2021-07-28
Sharing licenceMIT · LICENSE
Change size+1 1

What the code was meant to do, written into the code itself as a save note

Fix bug where a geodesic with lat1 = 0 and lat2 = nan was treated as equatorial (bug found 2021-07-26).

The change

726726 lat2 = Math.AngRound(Math.LatFix(lat2))
727727 # Swap points so that point with higher (abs) latitude is point 1
728728 # If one latitude is a nan, then it becomes lat1.
729- swapp = -1 if abs(lat1) < abs(lat2) else 1
729+ swapp = -1 if abs(lat1) < abs(lat2) or Math.isnan(lat2) else 1
730730 if swapp < 0:
731731 lonsign *= -1
732732 lat2, lat1 = lat1, lat2

The check that tells the two apart

failpass·geographiclib/test/test_geodesic.py::GeodSolveTest::test_GeodSolve94

Check file geographiclib/test/test_geodesic.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it62fe5d3a19643ca08661be2a739eb46689af7396
Broken version dated2021-07-14
Modulegeographiclib.geodesic
Units changedGeodesic
Fingerprint5d8cc7d139926824
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in geographiclib/geographiclib-python