Skip to content

define typemin and typemax? #318

@sglyon

Description

@sglyon

When using maximum(::Array, ::Int) with ForwardDiff, I get nasty errors saying Base.typemin is not defined.

As a stop-gap I just define it like this:

function Base.typemin(::Type{ForwardDiff.Dual{T,V,N}}) where {T,V,N}
    ForwardDiff.Dual{T,V,N}(typemin(V))
end

in my code, but that function probably really belongs here.

I would open a PR, but I'm not sure exactly where in dual.jl it belongs (e.g. which section of that file, so things stay organized) as well as whether or not it should be @inlined. Any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions