JuliaPhysics / JuliaPhysics/Unitful.jl

`StepRange` with float-based quantities should error

Open
#552 0 comments 0 reactions 0 assignees View on GitHub
ranges v2.0
Dominant language
Julia
Stars
675
Forks
124
Avg merge
3h 38m
Merged PRs (30d)
1

Description

When dealing with floating-point numbers, `StepRangeLen` should be used instead of `StepRange`. However, this is currently allowed:
```julia
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
julia> StepRange(1.0, 1.0, 3.0)
ERROR: ArgumentError: StepRange should not be used with floating point
[...]
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.