Skip to content

Commit e0fa634

Browse files
committed
Re-implement single argument @interval
1 parent e6169a3 commit e0fa634

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/intervals/construction.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ end
627627
# macro
628628

629629
"""
630+
@interval(expr)
630631
@interval(T, expr)
631632
@interval(T, expr1, expr2)
632633
@@ -638,13 +639,20 @@ constructor [`atomic`](@ref).
638639
```jldoctest
639640
julia> setdisplay(:full);
640641
641-
julia> @macroexpand @interval Float64 sin(1)
642+
julia> @macroexpand @interval sin(1) # Float64 is the default bound type
642643
:(sin(IntervalArithmetic.atomic(Float64, 1)))
643644
645+
julia> @macroexpand @interval Float32 sin(1)
646+
:(sin(IntervalArithmetic.atomic(Float32, 1)))
647+
644648
julia> @interval Float64 sin(1) exp(1)
645649
Interval{Float64}(0.8414709848078965, 2.7182818284590455, com)
646650
```
647651
"""
652+
macro interval(expr)
653+
return _wrap_interval(default_numtype(), expr)
654+
end
655+
648656
macro interval(T, expr)
649657
return _wrap_interval(T, expr)
650658
end

0 commit comments

Comments
 (0)