Skip to content

Commit

Permalink
fix empty condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcelo Forets committed Sep 21, 2024
1 parent 3dbcab6 commit 3b7698e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Continuous/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ function _get_T(tspan::TimeInterval; check_zero::Bool=true, check_positive::Bool
end

function compute_nsteps(δ, tspan)
# get time horizon from the time span imposing that it is of the form (0, T)
isempty(tspan) && return zero(δ)
# Get time horizon from the time span imposing that it is of the form (0, T).
T = _get_T(tspan; check_zero=true, check_positive=true)
return NSTEPS = ceil(Int, T / δ)
end
Expand Down

0 comments on commit 3b7698e

Please sign in to comment.