Skip to content
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

Support powers and roots for unit wrappers #376

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

chiphogg
Copy link
Contributor

This unlocks some basic missing functionality for Constant and
SymbolFor: namely, we should be able to pass instances of them to
squared(), sqrt(), pow<N>(), root<N>(), and so on.

Fixes #375.

This unlocks some basic missing functionality for `Constant` and
`SymbolFor`: namely, we should be able to pass instances of them to
`squared()`, `sqrt()`, `pow<N>()`, `root<N>()`, and so on.

Fixes #375.
@chiphogg chiphogg added the release notes: ✨ lib (enhancement) PR enhancing the library code label Jan 15, 2025
Copy link
Contributor

@geoffviola geoffviola left a comment

Choose a reason for hiding this comment

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

Motivation, implementation, and tests look good.


// UnitWrapper<Meters>{} * meters_pt;
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: Are these tests irrelevant now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops... actually, no! We deleted ForbidsComposingWith in #227, so I thought we forgot to remove this, but reading that PR summary I see that leaving these here was intentional.

@chiphogg chiphogg merged commit 6d0f7c0 into main Jan 15, 2025
14 checks passed
@chiphogg chiphogg deleted the chiphogg/powers-of-wrappers#375 branch January 15, 2025 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes: ✨ lib (enhancement) PR enhancing the library code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Constant and SymbolFor do not support rational powers
2 participants