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

isless behavior #27

Open
8me opened this issue Nov 28, 2020 · 1 comment
Open

isless behavior #27

8me opened this issue Nov 28, 2020 · 1 comment
Labels
question Further information is requested

Comments

@8me
Copy link
Collaborator

8me commented Nov 28, 2020

The behavior of Base.isless between a MeasuredValue and a Quantity is currently discussed, as its definition can lead to confusion in our eyes (@8me and @tamasgal).
The idea of the current implementation says, that the comparison has to be definitely correct to return true. In the following example

julia> p = Particle(-319)
Particle(-319) K(4)*(2045)

julia> p.mass
2048.0 MeV + 9.0 MeV - 8.0 MeV

it means

julia> p.mass > 2050u"MeV"
false

because the within the limits the particle can be greater (up to 2057MeV), but it is not sure. This handling leads on the other hand to:

julia> p.mass < 2050u"MeV"
false

because it is also within limits and no clear statement can be made. One option (beside not touching the current behavior) could be, to compare it directly to the mass value of the catalog and ignore the limits. But from my point of view there is a reason, why the values are coming with the limits .... so ... let the games, i.e. the discussion, begin! 😉

@tamasgal
Copy link
Member

Yes, so indeed, whenever I have to do with this (demo purposes or whatever), I get confused a bit but of course, our logic and current implementation makes sense 😉

In any case, the user is always able to use the mean/median value:

julia> p.mass.value
2048.0 MeV

which is just a basic Quantity.

@tamasgal tamasgal added the question Further information is requested label Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants