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

Define ≈ operator for Intervals #150

Open
mzgubic opened this issue Nov 18, 2020 · 0 comments · May be fixed by #152
Open

Define ≈ operator for Intervals #150

mzgubic opened this issue Nov 18, 2020 · 0 comments · May be fixed by #152
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mzgubic
Copy link
Contributor

mzgubic commented Nov 18, 2020

julia> i1 = Interval{Float64, Open, Closed}(1, 2)
Interval{Float64,Open,Closed}(1.0, 2.0)

julia> i2 = Interval{Float64, Open, Closed}(1, 2 + 1e-10)
Interval{Float64,Open,Closed}(1.0, 2.00001)

julia> i1 ≈ i2
ERROR: MethodError: no method matching isapprox(::Interval{Float64,Open,Closed}, ::Interval{Float64,Open,Closed})

How would this behaviour be defined?

  • The lower and upper bounds would have to be ≈ equal separately.

  • The closed/open distinction would be ignored.

  • If the underlying types don't have ≈ defined an error is thrown?

@mzgubic mzgubic added good first issue Good for newcomers enhancement New feature or request labels Nov 18, 2020
@gxyd gxyd linked a pull request Dec 1, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant