Skip to content

Extension for Unitful #720

@Kolaru

Description

@Kolaru

It seems like it is mostly possible to use Interval with Untiful:

julia> 1.5u"m" * interval(1, 2)u"m"
[1.49999, 3.0]_com_NG m^2

The only caveat that I found are the set operations that we define for interval only

julia> in_interval(1.5u"m", interval(1, 2)u"m")
ERROR: MethodError: no method matching in_interval(::Quantity{Float64, 𝐋, Unitful.FreeUnits{…}}, ::Quantity{Interval{…}, 𝐋, Unitful.FreeUnits{…}})
[...]

This could easily be fixed with an extension.

(and then IntervalRootFinding should be compatible with Unitful for free, which is cool)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions