Skip to content

Commit 3aa8b6a

Browse files
authored
Accept tolerance kw in isapprox(::Fun, ::Number) (#455)
1 parent ab2efb2 commit 3aa8b6a

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunBase"
22
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
3-
version = "0.8.17"
3+
version = "0.8.18"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/Fun.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,8 @@ function isapprox(f::Fun,g::Fun;
761761
end
762762
end
763763

764-
isapprox(f::Fun, g::Number) = f g*ones(space(f))
765-
isapprox(g::Number, f::Fun) = g*ones(space(f)) f
764+
isapprox(f::Fun, g::Number; kw...) = isapprox(f, g*ones(space(f)); kw...)
765+
isapprox(g::Number, f::Fun; kw...) = isapprox(g*ones(space(f)), f; kw...)
766766

767767

768768
isreal(f::Fun{<:RealSpace,<:Real}) = true

test/runtests.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,5 +678,10 @@ end
678678
@test !ApproxFunBase.isleftendpoint(rightendpoint)
679679
end
680680

681+
@testset "Fun isapprox with kw" begin
682+
@test isapprox(Fun(1), 1, atol=1e-10)
683+
@test isapprox(1, Fun(1), atol=1e-10)
684+
end
685+
681686
@time include("ETDRK4Test.jl")
682687
include("show.jl")

0 commit comments

Comments
 (0)