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

Create min/max functions that take bounds into account #137

Closed
morris25 opened this issue Aug 13, 2020 · 1 comment · Fixed by #141
Closed

Create min/max functions that take bounds into account #137

morris25 opened this issue Aug 13, 2020 · 1 comment · Fixed by #141
Assignees

Comments

@morris25
Copy link
Member

It would be nice to be able to get the first and last item within the bounds an Interval to some precision.
Ex.

julia> function min(i::Interval{T, Open}; precision=eps(T)) where T
       return first(i) + precision
end 

julia> function min(i::Interval{T, Closed}; precision=eps(T)) where T
       return first(i)
end

julia> min(Interval{Open, Open}(1.0, 2.0); precision=0.1)
1.1

julia> min(Interval{Closed, Closed}(1.0, 2.0); precision=0.1)
1.0
@nickrobinson251
Copy link
Contributor

xref #90 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants