Skip to content

Commit

Permalink
Dispatch for exponentiation on Float32 intervals (#482)
Browse files Browse the repository at this point in the history
* Dispatch for exponentiation on Float32 intervals

* Update functions.jl

* ups

* add test

Co-authored-by: lucaferranti <49938764+lucaferranti@users.noreply.github.com>
  • Loading branch information
mfherbst and lucaferranti committed May 7, 2022
1 parent 0acb83b commit 06f49c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/intervals/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
for T in (:Integer, :Float64, :BigFloat, :Interval)
@eval ^(a::Interval{Float64}, x::$T) = atomic(Interval{Float64}, bigequiv(a)^x)
end

^(a::Interval{Float32}, x::Interval) = atomic(Interval{Float32}, bigequiv(a)^x)

# Integer power:

Expand Down
1 change: 1 addition & 0 deletions test/interval_tests/numeric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ end
a = Interval{Float32}(1e38)
b = Interval{Float32}(1e2)
@test a * b == Interval{Float32}(floatmax(Float32), Inf)
@test Interval(1.0f0) ^ Interval(1.0f0) == Interval(1.0f0) # test for PR #482
end


Expand Down

0 comments on commit 06f49c2

Please sign in to comment.