[PROJ] spilhaus regresssion test failures
Greg Troxel
gdt at lexort.com
Sun May 4 16:30:21 PDT 2025
Greg Troxel via PROJ <proj at lists.osgeo.org> writes:
> I looked at that code, and it jumped out at me that are abs() was used,
> which is a C function, not C++, and is integer only.
>
> With this patch (to 9.6.0), I get a pass:
>
> --- src/latitudes.cpp.~1~ 2025-03-13 10:31:27.000000000 -0400
> +++ src/latitudes.cpp 2025-05-04 14:23:04.656697860 -0400
> @@ -58,7 +58,7 @@
> 2 * atan(taninit *
> std::pow(((1 + esinphi) / (1 - esinphi)), (e / 2))) -
> 0.5 * M_PI;
> - if (abs(new_phi - phi) < threshold) {
> + if (std::abs(new_phi - phi) < threshold) {
> phi = new_phi;
> break;
> }
>
> Interesting that this only causes trouble with spilhaus, at least as far
> as tests catch it.
Which do we want to do:
A) pullup the PR #4446 (@cffk aux latitude cleanup) to the 9.6 release
branch
B) Decide not to pullup, and change abs to std::abs?
If B, I can make a PR, but if we're going to do A, that isn't useful.
FWIW, I would tend to lean to A, as a grand simplification, but as I
read the discussion it's considered over the line to feature vs bugfix
and I can certainly see that point of view.
More information about the PROJ
mailing list