Skip to content

Commit c293866

Browse files
committed
Put @generated at the end
1 parent af8be29 commit c293866

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/IntervalArithmetic.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,14 @@ end
9393

9494
configure()
9595

96+
#
97+
98+
bareinterval(::Type{BigFloat}, a::AbstractIrrational) = _unsafe_bareinterval(BigFloat, a, a)
99+
100+
# Note: generated functions must be defined after all the methods they use
101+
@generated function bareinterval(::Type{T}, a::AbstractIrrational) where {T<:NumTypes}
102+
x = _unsafe_bareinterval(T, a(), a()) # precompute the interval
103+
return :($x) # set body of the function to return the precomputed result
104+
end
105+
96106
end

src/intervals/intervals.jl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,3 @@ include("interval_operations/set_operations.jl")
4444
export intersect_interval, hull, interiordiff
4545
include("interval_operations/bisect.jl")
4646
export bisect, mince, mince!
47-
48-
#
49-
50-
bareinterval(::Type{BigFloat}, a::AbstractIrrational) = _unsafe_bareinterval(BigFloat, a, a)
51-
52-
# Note: generated functions must be defined after all the methods they use
53-
@generated function bareinterval(::Type{T}, a::AbstractIrrational) where {T<:NumTypes}
54-
x = _unsafe_bareinterval(T, a(), a()) # precompute the interval
55-
return :($x) # set body of the function to return the precomputed result
56-
end

0 commit comments

Comments
 (0)