-
Notifications
You must be signed in to change notification settings - Fork 11
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
Scalars should compare equal if the underlying quantity measure is OK #26
Labels
enhancement
New feature or request
Comments
Another annoying side-effect: >>> {Scalar(1,'m'), Scalar(100, 'cm')}
{Scalar(1.0, 'm', 'length'), Scalar(100.0, 'cm', 'length')} This should have returned: >>> {Scalar(1,'m'), Scalar(100, 'cm')}
{Scalar(1.0, 'm', 'length')} |
and >>> {Scalar(100, 'cm'), Scalar(1,'m')}
{Scalar(100.0, 'cm', 'length')}
>>> {Scalar(100.0, 'cm', 'length')} == {Scalar(1.0, 'm', 'length')}
True ? This will make the scalar hash being a bit slower. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think
Scalar(1, "m")
should compare equal toScalar(100, "cm")
. This would allow us to write more natural code like:Instead of being forced to write:
pint works this way:
From this discussion: https://eden.esss.com.br/stash/projects/ESSS/repos/alfasim/pull-requests/1690/overview?commentId=120265
The text was updated successfully, but these errors were encountered: