julia
c9140623 - handle the condition in `in` when `step(r::AbstractRange)` equals 0 (#41974)

Commit
4 years ago
handle the condition in `in` when `step(r::AbstractRange)` equals 0 (#41974) * handle the condition in `in` when `step` equals 0 Using `in` when `step(r::AbstractRange) == 0` results in an error. Handle this case by using boolean logic for both the definitions to which this case applies (`x::Real` and `x::AbstractChar`). First, check if the step equals zero and if `x` (the value) equals the reference value before performing the invalid `mod` operation. Signed-off-by: Anant Thazhemadam <anant.thazhemadam@gmail.com> * add tests for `StepRangeLen` when step equals 0 Add two tests (one which passes and another which fails) each, for `in` with `StepRangeLen` that has step = 0, where `x` is of type `Real` and `AbstractChar`. Signed-off-by: Anant Thazhemadam <anant.thazhemadam@gmail.com>
Author
Parents
Loading