Skip to content

Commit 06f49c2

Browse files
Dispatch for exponentiation on Float32 intervals (#482)
* Dispatch for exponentiation on Float32 intervals * Update functions.jl * ups * add test Co-authored-by: lucaferranti <[email protected]>
1 parent 0acb83b commit 06f49c2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/intervals/functions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
for T in (:Integer, :Float64, :BigFloat, :Interval)
1010
@eval ^(a::Interval{Float64}, x::$T) = atomic(Interval{Float64}, bigequiv(a)^x)
1111
end
12-
12+
^(a::Interval{Float32}, x::Interval) = atomic(Interval{Float32}, bigequiv(a)^x)
1313

1414
# Integer power:
1515

test/interval_tests/numeric.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ end
377377
a = Interval{Float32}(1e38)
378378
b = Interval{Float32}(1e2)
379379
@test a * b == Interval{Float32}(floatmax(Float32), Inf)
380+
@test Interval(1.0f0) ^ Interval(1.0f0) == Interval(1.0f0) # test for PR #482
380381
end
381382

382383

0 commit comments

Comments
 (0)