Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different results in Boost.Geometry after rational_adaptor change. #387

Closed
awulkiew opened this issue Oct 26, 2021 · 2 comments
Closed

Different results in Boost.Geometry after rational_adaptor change. #387

awulkiew opened this issue Oct 26, 2021 · 2 comments

Comments

@awulkiew
Copy link
Member

At Boost.Geometry we noticed that one test case started to fail after this change: 4815cb0 / PR #366
in particular this one:
https://github.com/boostorg/geometry/blob/d0838774aae3c73f208f89623e0a1423973381b7/test/algorithms/set_operations/union/union_other_types.cpp#L145
where cpp_rational aka number<backends::rational_adaptor<backends::cpp_int_backend<...>>...> is used as coordinate type of tested geometries.

The results are different than they were in the past and different than we get with boost::rational and other coordinate types.

To reproduce:

cd libs/geometry
git fetch origin
git checkout d0838774a
../../b2 test/algorithms/set_operations/union//algorithms_union_other_types

If you have any suggestions what I could do to help you find the issue feel free to ask.

@jzmaddock
Copy link
Collaborator

This took a bit of tracking down, somewhere in your code there is a default constructed value which is later used in a comparison. The regression in Multiprecision was that default constructed values changed from 0 to 1 (now fixed in commit referenced above). You may wish to track down that stray default-constructed (uninitialised?) value though.

@awulkiew
Copy link
Member Author

Thanks! Yes, there are many places like this in Geometry where we assume that default constructed values are equal to 0 which corresponds to value initialization of fundamental types. But I agree that we should rather assign 0 explicitly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants