Skip to content

Conversation

@SwayamInSync
Copy link
Member

Copilot Summary

This pull request adds support for converting radians to degrees in quad-precision and long double types, implements the corresponding ufuncs (degrees and rad2deg), and introduces comprehensive tests for these operations. It also updates the release tracker to reflect the new functionality.

New quad-precision and long double degree conversion support:

  • Added quad_degrees and ld_degrees functions to convert radians to degrees for Sleef_quad and long double types, respectively (quaddtype/numpy_quaddtype/src/ops.hpp). [1] [2]

Ufunc integration:

  • Registered the new degrees and rad2deg ufuncs for quad-precision and long double types in the NumPy extension (quaddtype/numpy_quaddtype/src/umath/unary_ops.cpp).

Testing improvements:

  • Added parameterized tests to verify correctness of the degrees and rad2deg ufuncs, including edge cases and special values (quaddtype/tests/test_quaddtype.py).

Documentation and tracking:

  • Updated the release tracker to indicate that degrees and rad2deg are now implemented and tested (quaddtype/release_tracker.md).

@SwayamInSync
Copy link
Member Author

both ufuncs are equivalent

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request implements the degrees and rad2deg ufuncs for converting radians to degrees in quad-precision and long double types. Both functions perform the same mathematical operation but provide alternative API names for consistency with NumPy conventions.

  • Added quad_degrees and ld_degrees functions that convert radians to degrees using the formula radians * 180 / π
  • Registered both degrees and rad2deg ufuncs in the NumPy extension system
  • Added comprehensive parameterized tests covering basic conversions, negative values, special values (inf, nan), and edge cases

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
quaddtype/numpy_quaddtype/src/ops.hpp Implements the core conversion functions for quad-precision and long double types
quaddtype/numpy_quaddtype/src/umath/unary_ops.cpp Registers the new ufuncs with NumPy's universal function system
quaddtype/tests/test_quaddtype.py Adds parameterized tests for both ufuncs with comprehensive test cases
quaddtype/release_tracker.md Updates documentation to mark degrees and rad2deg as implemented

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@SwayamInSync
Copy link
Member Author

Merging this in!

@SwayamInSync SwayamInSync merged commit 6f59499 into numpy:main Oct 18, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants