Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dpsanders committed Jul 29, 2024
1 parent 86ad421 commit a177d0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/trig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function cos_main(X::IntervalBox)
end

# TODO: Be careful with the pi constants if using e.g. BigFloats
cos_reverse = symmetrise(cos_main, reflect_x(0.0))
cos_reverse = symmetrise(cos_main, reflect_x(zero))

"""
cos!(X::IntervalBox)
Expand Down Expand Up @@ -128,7 +128,7 @@ function tan_main(X::IntervalBox)

x, y = X

h = sup(half_pi)
h = sup(half_pi(x))

x_range = _build_interval(x, -h, h)

Expand All @@ -143,7 +143,7 @@ function tan_main(X::IntervalBox)

end

tan!(X::IntervalBox) = periodise(tan_main, interval(π))(X)
tan!(X::IntervalBox) = periodise(tan_main, pi_interval)(X)

"""
tan_rev(c::IntervalType[, x::IntervalType])
Expand Down
5 changes: 4 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ using IntervalContractors
using IntervalArithmetic
using Test

using IntervalContractors: IntervalType

# cache current power mode:
orig_power_mode = IntervalArithmetic.power_mode()

Expand Down Expand Up @@ -37,7 +39,8 @@ approx_eq(x::IntervalType, y::IntervalType) =
end

@testset "Exponents with integer values but not types" begin
@test all(eq.(power_rev(entireinterval(), -interval(4, 4), 2.0), (entireinterval(), interval(-4, -4), 2.0)))
@test eq(power_rev(entireinterval(), interval(-4, 4), interval(2.0)),
(entireinterval(), interval(-4, 4), interval(2.0)))
end
end

Expand Down

0 comments on commit a177d0f

Please sign in to comment.