Skip to content

Commit

Permalink
Empty input array should return itself
Browse files Browse the repository at this point in the history
  • Loading branch information
terasakisatoshi committed Dec 12, 2024
1 parent c8be749 commit 5ad2767
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/_roots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ closeenough(a::T, b::T, ϵ) where {T<:AbstractFloat} = isapprox(a, b; rtol=0, at
closeenough(a::T, b::T, _) where {T<:Integer} = a == b

function refine_grid(grid::Vector{T}, ::Val{α}) where {T, α}
isempty(grid) && return grid
n = length(grid)
newn = α * (n - 1) + 1
newgrid = Vector{float(T)}(undef, newn)
Expand Down

0 comments on commit 5ad2767

Please sign in to comment.