Skip to content

mpfdtype: Fix routing issues and add tests. - #263

Open
rabbott999 wants to merge 1 commit into
numpy:mainfrom
rabbott999:main
Open

rabbott999 wants to merge 1 commit into
numpy:mainfrom
rabbott999:main

Conversation

@rabbott999

Copy link
Copy Markdown

These are all issues with where different ufuncs are routed, and adds a test for unary ufuncs which would've caught the issue.

The issues are:

  • The implementations of np.square and np.sqrt are swapped (ironically this doesn't show up in the README example since it uses arr**2 + np.sqrt(a))
  • np.arctan calls mpf_tan instead of mpfr_atan
  • np.exp2 calls exp instead of exp2
  • Functions are implemented for np.sin, np.cos, and np.tan, but they are not registered in umath.cpp.

For full disclosure, I found these issues while pointing an LLM at the codebase, but the changes and write-up are my own.

These are all issues with where different ufuncs are routed, and adds
a test for unary ufuncs which would've caught the issue.

The issues are:

- The implementations of np.square and np.sqrt are swapped (ironically
this doesn't show up in the README example since it uses arr**2 + np.sqrt(a))
- np.arctan calls mpf_tan instead of mpfr_atan
- np.exp2 calls exp instead of exp2
- Functions are implemented for np.sin, np.cos, and np.tan, but they
are not registered in umath.cpp.
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

Successfully merging this pull request may close these issues.

1 participant