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

Support broadcasting for +, -, *, / in 0.7? #32

Open
dlfivefifty opened this issue Jul 31, 2018 · 2 comments · May be fixed by #55
Open

Support broadcasting for +, -, *, / in 0.7? #32

dlfivefifty opened this issue Jul 31, 2018 · 2 comments · May be fixed by #55

Comments

@dlfivefifty
Copy link
Member

While it makes sense to not override +, etc. to mean interval arithmetic, overriding broadcast notation seems less confusion. I'd propose that broadcasting is meant in the sense of set arithmetic: that is, x in d1 .+ d2 iff there exists s in d1 and t in d2 such that x == s+t. In particular,

(1..2) .+ 1 == 2..3
(1..2) .+ (3..4) == 4..6
(1..2) .+ (3..5) == 4..7
3 .* (1..2) == 3..6

Less clear is what to do for discontinuous special functions:

exp.(1..2) == exp(1) .. exp(2)
sign.(1..2) == 1..1
sign.(-1 .. 1) # throws error? But how to catch this?
@tkf tkf linked a pull request Sep 14, 2019 that will close this issue
@timholy
Copy link
Member

timholy commented Sep 15, 2019

I really like this suggestion since it's a natural consequence of interval-as-container.

For practical implementation, there is one major concern: roundoff error. I'll discuss in #55.

@jariji
Copy link

jariji commented Apr 3, 2024

Can map be defined on these too?

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