Skip to content

StepRange with float-based quantities should error #552

@sostock

Description

@sostock

When dealing with floating-point numbers, StepRangeLen should be used instead of StepRange. However, this is currently allowed:

julia> StepRange(1.0u"m", 1.0u"m", 3.0u"m")
(1.0:1.0:3.0) m

I would argue that it should error, like it does for unitless numbers:

julia> StepRange(1.0, 1.0, 3.0)
ERROR: ArgumentError: StepRange should not be used with floating point
[...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    rangesranges (StepRange, StepRangeLen) of quantitiesv2.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions