Skip to content

Conversation

@chiphogg
Copy link
Member

@chiphogg chiphogg commented May 5, 2025

Our interop with the chrono library should not support negative
magnitudes, so we add a static_assert.

Constants should be negatable, and double-negatives should completely
cancel out. We achieve this by adding support for negation at the "unit
wrapper" level, for any wrapper that can be scaled by a magnitude.

If we simply negate a unit (or constant), the scale factor should simply
be a - sign: we don't want to print a scale factor of -1.

Finally, we punt on the runtime conversion checkers: they are only
supported for positive units. There's no sense in putting effort into
an implementation that will be obviated by #387 and #349.

Helps #370.

Our interop with the chrono library should not support negative
magnitudes, so we add a `static_assert`.

Constants should be negatable, and double-negatives should completely
cancel out.  We achieve this by adding support for negation at the "unit
wrapper" level, for any wrapper that can be scaled by a magnitude.

If we simply negate a unit (or constant), the scale factor should simply
be a `-` sign: we don't want to print a scale factor of `-1`.

Finally, we punt on the runtime conversion checkers: they are only
supported for positive units.  There's no sense in putting effort into
an implementation that will be obviated by #387 and #349.

Helps #370.
@chiphogg chiphogg merged commit 25cbe3c into main May 5, 2025
15 checks passed
@chiphogg chiphogg deleted the chiphogg/finish-neg-mags#370 branch May 5, 2025 14:21
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.

3 participants