BLD: Add missing gcd/lcm definitions to npy_math.h #14160
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #14121 .
gcd/lcm was added in 7ab0f15
I believe it was an oversight to not add the function definitions to npy_math.h, which resulted in an implicit function declaration for me which means the result of gcd is truncated to 32 bits (which is correct for the vast majority of results) but not all.
Luckily the gcd_overflow test caught this. Unfortantely I had -w on and didn't see the -Wimplicit-function-declaration error and the test case result is 2^64 which was truncated to 0 so it took quite a bit of my time to debug.
I'm not sure if this should be labelled BLD, ENH, or MAINT.
I'm also not sure where in the file you'd like these sorted.