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

Fix a bug in BaseDimensions.IsBaseQuantity() #1430

Conversation

ygorshkov
Copy link
Contributor

@ygorshkov ygorshkov commented Oct 23, 2024

Current implementation of BaseDimensions.IsBaseQuantity() ignores any dimension which power is not 1.
So it treats derived quantities (like Acceleration shown in unit test) as base ones.
This PR fixes a bug

@ygorshkov ygorshkov changed the title Fixes a bug in BaseDimensions.IsBaseQuantity method Fix a bug in BaseDimensions.IsBaseQuantity() Oct 23, 2024
@ygorshkov ygorshkov force-pushed the bugfix/base-dimensions/is-base-quantity branch from 0df7b6b to cb69e34 Compare October 23, 2024 19:10
Copy link
Owner

@angularsen angularsen left a comment

Choose a reason for hiding this comment

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

Good find! A couple of suggestions:

UnitsNet.Tests/BaseDimensionsTests.cs Show resolved Hide resolved
UnitsNet/BaseDimensions.cs Outdated Show resolved Hide resolved
@ygorshkov ygorshkov force-pushed the bugfix/base-dimensions/is-base-quantity branch from 9326b75 to 5104c51 Compare October 25, 2024 09:52
@ygorshkov ygorshkov force-pushed the bugfix/base-dimensions/is-base-quantity branch from 5104c51 to 9d20fd8 Compare October 25, 2024 09:55
@ygorshkov ygorshkov requested a review from angularsen October 25, 2024 10:13
@angularsen angularsen merged commit e32a276 into angularsen:master Dec 7, 2024
1 check passed
@angularsen
Copy link
Owner

Sorry for being late here, it drowned in my inbox and I forgot it.

@angularsen
Copy link
Owner

Thanks! Nuget should be out shortly.

Release UnitsNet/5.61.0 · angularsen/UnitsNet

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.

2 participants