Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Implement float math functions for two arrays #1516

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

Open
Waterdragen wants to merge 8 commits into rust-ndarray:master
base: master
Choose a base branch
Loading
from Waterdragen:float-fn-two-arrays

Conversation

@Waterdragen
Copy link
Contributor

@Waterdragen Waterdragen commented May 28, 2025

Rationale

Since we have something like array.binary_fn(float), we could also have array.binary_fn(array).
Extends functionality of #1042 and #1507

New binary methods for RHS = float

  • atan2

New binary methods for RHS = arrays

  • powi_all
  • powf_all
  • log_all
  • abs_sub_all
  • hypot_all
  • atan2_all

Copy link
Collaborator

Can you please add one test for at least one of those functions?

Waterdragen reacted with thumbs up emoji

Test a function of: boolean op, unary op, binary op, binary op with arrays
Copy link
Contributor Author

Hi there! I've added a test for hypot_all. I've also added tests for boolean, unary, and binary ops for #1042.

Copy link
Collaborator

LGTM. I'll leave time for the other maintainers to react, if need be, then I'll merge.

Copy link
Collaborator

akern40 commented May 28, 2025

I'm not sure this is the right approach here. If we grant that we want this (and I think we do?) I'd rather we take advantage of generics and traits to make it happen. I had a working example at #1469 of what this might look like.

We also should consider whether a method like this should perform broadcasting for the user or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /