Skip to content

Box space equality is not correct #21

@v-i-s-h

Description

@v-i-s-h

Box space with different datatypes are compared to be equal if range is same.
MWE:

julia> box1 = Box(0, 255, (1,), Float32)
Box(Float32[0.0], Float32[255.0], (1,), Float32)

julia> box2 = Box(0, 255, (1,), UInt8)
Box(UInt8[0x00], UInt8[0xff], (1,), UInt8)

julia> sample(box1)
1-element Array{Float32,1}:
 168.51285

julia> sample(box2)
1-element Array{UInt8,1}:
 0x7d

julia> box1 == box2
true    # <--- This should be false!!

Maybe we should make Box(0, 255, (1,), UInt8) != Box(0, 255, (1,), UInt16) and Box(0, 255, (1,), UInt8) != Box(0, 255, (1,), Int8) as the return data type may cause typeistability down the line.

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