Skip to content

Commit

Permalink
Merge pull request #579
Browse files Browse the repository at this point in the history
Fix doctests
  • Loading branch information
OlivierHnt authored Aug 29, 2023
2 parents b26a28e + b40e00c commit 0d6ff9e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
13 changes: 6 additions & 7 deletions src/intervals/construction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,18 @@ function, however it should be set to a concrete subtype of `Rational` or
# Examples
```jldoctest
julia> IntervalArithmetic.default_numtype()
Float64
julia> IntervalArithmetic.default_numtype() = Float32
julia> typeof(interval(1, 2))
Interval{Float64}
Interval{Float32}
julia> typeof(interval(1, big(2)))
Interval{BigFloat}
julia> IntervalArithmetic.default_numtype() = Float32
julia> IntervalArithmetic.default_numtype() = Float64
julia> typeof(interval(1, 2))
Interval{Float32}
Interval{Float64}
julia> typeof(interval(1, big(2)))
Interval{BigFloat}
Expand Down Expand Up @@ -209,10 +208,10 @@ See also: [`interval`](@ref), [`..`](@ref) and [`@I_str`](@ref).
```jldoctest
julia> setformat(:full);
julia> 0.0 ± π
julia> 0 ± π
Interval{Float64}(-3.1415926535897936, 3.1415926535897936)
julia> Int64(0)//1 ± π
julia> 0//1 ± π
Interval{Rational{Int64}}(-85563208//27235615, 85563208//27235615)
```
"""
Expand Down
2 changes: 1 addition & 1 deletion src/parsing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ decoration; otherwise, it is semantically equivalent to
```jldoctest
julia> setformat(:full);
julia> I"[3.0, 4.0]"
julia> I"[3, 4]"
Interval{Float64}(3.0, 4.0)
julia> I"0.1"
Expand Down
15 changes: 15 additions & 0 deletions src/symbols.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ Create an interval according to the IEEE Standard 1788-2015. This is
semantically equivalent to [`interval(a, b)`](@ref).
See also: [`interval`](@ref), [`±`](@ref) and [`@I_str`](@ref).
# Examples
```jldoctest
julia> using IntervalArithmetic
julia> using IntervalArithmetic.Symbols
julia> setformat(:full);
julia> (1//1)..π
Interval{Rational{Int64}}(1//1, 85563208//27235615)
julia> 0.1..0.3
Interval{Float64}(0.1, 0.3)
```
```
"""
const .. = interval
Expand Down

0 comments on commit 0d6ff9e

Please sign in to comment.