Skip to content

rand throws InexactError #173

@matthieuzone

Description

@matthieuzone

rand throws an InexactError when called on multi-dimensional DomainSets of Ints

Examlple

rand(1..10) returns a Float64 between 1 and 10
rand((1..10) × (1..10)) throws InexactError: Int64(random float)

If 1..10 is supposed to be continuous, I guess (1..10) × (1..10) should too.

Note that
typeof(1..10) is IntervalSets.ClosedInterval{Int64}
and typeof((1..10) × (1..10)) is DomainSets.Rectangle{SVector{2, Int64}}

suggesting that these are intervals of integers, so rand would maybe give an integer ? Or else, 1..10 should automatically convert it's type to float ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions