Skip to content

isless behavior #27

Open
Open
@8me

Description

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! 😉

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions