From a011fd0edd9719a66d135ed2713954551765e15e Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Tue, 29 Dec 2020 08:24:18 -0500 Subject: [PATCH] Simplify type construction with AbstractFloat time Unitful numbers are not AbstractFloat so it handles this case better. --- src/solve.jl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/solve.jl b/src/solve.jl index 7b731ddd9..48a88d4cd 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -264,7 +264,14 @@ function DiffEqBase.__init( saveiter = 0 end - QT = tTypeNoUnits <: Integer ? typeof(qmin) : tTypeNoUnits + QT = if tTypeNoUnits <: Union{Integer,AbstractFloat} + typeof(qmin) + elseif prob isa DiscreteProblem + # The QT fields are not used for DiscreteProblems + constvalue(tTypeNoUnits) + else + typeof(internalnorm(u, t)) + end uprev = recursivecopy(u)