Skip to content

isapprox not defined for Tuple arguments #18779

@dbeach24

Description

@dbeach24

Seems like it would make sense to have isapprox be defined for Tuples.

julia> isapprox((1,2),(1,2))
ERROR: MethodError: no method matching isapprox(::Tuple{Int64,Int64}, ::Tuple{Int64,Int64})

This should at least hold for tuples of matching type, although perhaps a more permissive rule would be useful. Candidate implementation:

Base.isapprox{T <: Tuple}(x::T, y::T) = all(isapprox(a,b) for (a,b) in zip(x,y))

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