JuliaMath/Primes.jl

primes(0) returns error

blackeneth opened this issue · 0 comments

Problem Statement
primes(0) returns an error.

Desired Behavior
primes(0) returns a 0-element array like primes(0,0) and primes(0,1) do.

Example

julia> primes(0)
ERROR: ArgumentError: The condition lo ≤ hi must be met.
Stacktrace:
 [1] primes(::Int64, ::Int64) at C:\Users\amgough\.juliapro\JuliaPro_v1.4.0-1\packages\Primes\uaYlp\src\Primes.jl:111
 [2] primes(::Int64) at C:\Users\amgough\.juliapro\JuliaPro_v1.4.0-1\packages\Primes\uaYlp\src\Primes.jl:126
 [3] top-level scope at none:0

julia> primes(0,0)
0-element Array{Int64,1}

julia> primes(0,1)
0-element Array{Int64,1}

Julia version and Primes.jl version:

julia> versioninfo()
Julia Version 1.4.0
Commit b8e9a9ecc6 (2020-03-21 16:36 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-4960X CPU @ 3.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, ivybridge)
julia> Pkg.status("LinearAlgebra")
 [37e2e46d] LinearAlgebra