Skip to content

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

Open
@dlfivefifty

Description

@dlfivefifty

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions