diff --git a/src/common.jl b/src/common.jl index cfb9216c7..8ff89981c 100644 --- a/src/common.jl +++ b/src/common.jl @@ -47,8 +47,11 @@ function solve{uType,tType,isinplace,AlgType<:ODEjlAlgorithm}( u0 = prob.u0 if typeof(saveat) <: Number - saveat_vec = convert(Vector{tType}, saveat+tspan[1]:saveat:(tspan[end]-saveat)) - # Exclude the endpoint because of floating point issues + if (tspan[1]:saveat:tspan[end])[end] == tspan[end] + saveat_vec = convert(Vector{tType},collect(tType,tspan[1]+saveat:saveat:tspan[end])) + else + saveat_vec = convert(Vector{tType},collect(tType,tspan[1]+saveat:saveat:(tspan[end]-saveat))) + end else saveat_vec = convert(Vector{tType}, collect(saveat)) end