diff --git a/src/trig.jl b/src/trig.jl index 356d616..77214c1 100644 --- a/src/trig.jl +++ b/src/trig.jl @@ -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) @@ -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) @@ -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]) diff --git a/test/runtests.jl b/test/runtests.jl index 90e3932..88c77e7 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,6 +2,8 @@ using IntervalContractors using IntervalArithmetic using Test +using IntervalContractors: IntervalType + # cache current power mode: orig_power_mode = IntervalArithmetic.power_mode() @@ -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