FEAT: ldexp ufunc implementation#195
Merged
SwayamInSync merged 7 commits intonumpy:mainfrom Oct 23, 2025
Merged
Conversation
Member
Author
|
I need to fix this, it seems the int is causing issue here |
juntyr
reviewed
Oct 22, 2025
Member
Author
|
great so indeed the issue was in the different system size of int. Let me clean the code and see if I can generalize it better |
Member
Author
|
one more thing to note is that on these systems long double is 128 bit hence Sleef_quad is also getting mapped to long double |
Member
Author
|
@juntyr ready for review now |
juntyr
reviewed
Oct 23, 2025
juntyr
approved these changes
Oct 23, 2025
Contributor
juntyr
left a comment
There was a problem hiding this comment.
LGTM, with the nit addressed
Co-authored-by: Juniper Tyree <[email protected]>
Contributor
|
@SwayamInSync Ok, feel free to merge once CI is green |
Member
Author
|
Merging this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Copilot Summary
This pull request adds full support for the
ldexpfunction (computingx * 2**exp) for quad precision types in the codebase. It introduces the mixed-type operation for quad and integer types, integrates the operation as a NumPy ufunc, and provides comprehensive tests to ensure correctness and edge case handling. The release tracker is updated to reflect this new support.Quad precision
ldexpimplementation:quad_ldexpandld_ldexpfor quad and long double types, including proper handling of NaN, zero, and infinity cases inops.hpp.NumPy ufunc integration:
ldexpufunc, and registered the ufunc with proper type promotion inbinary_ops.cpp.ldexpufunc ininit_quad_binary_ops, making it available for use.Testing and documentation:
ldexpfunction, covering basic functionality, zero, infinity, NaN, overflow, and underflow cases intest_quaddtype.py.ldexpas implemented and tested for quad precision.