Skip to content

Commit

Permalink
FiniteDiff: eagerly promote Bool type to float
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnychen94 authored May 17, 2022
1 parent 18d2856 commit bda38d0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/diff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ _fdiff_default_dims(A) = nothing
_fdiff_default_dims(A::AbstractVector) = 1

maybe_floattype(::Type{T}) where T = T
maybe_floattype(::Type{Bool}) = floattype(Bool)
maybe_floattype(::Type{T}) where T<:FixedPoint = floattype(T)
maybe_floattype(::Type{CT}) where CT<:Color = base_color_type(CT){maybe_floattype(eltype(CT))}

Expand Down

0 comments on commit bda38d0

Please sign in to comment.