Skip to content

Commit

Permalink
Fix doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHnt committed Oct 1, 2023
1 parent 747a2cf commit d282785
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Documenter, IntervalArithmetic

makedocs(
DocMeta.setdocmeta!(IntervalArithmetic, :DocTestSetup, :(using IntervalArithmetic))

makedocs(;
modules = [IntervalArithmetic],
authors = "David P. Sanders and Luis Benet",
sitename = "IntervalArithmetic.jl",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ If you use the IntervalArithmetic library in your publication, research, teachin
This project began in 2014 during a masters' course in the postgraduate programs of Mathematics and Physics at the Universidad Nacional Autónoma de México. It was initially written in Python, then reinitiated in 2015 and rewritten in Julia. We thank the participants of the courses for their contribution, energy and ideas.


### Support
## Support

Financial support is acknowledged from DGAPA-UNAM PAPIME grants PE-105911 and PE-107114, and DGAPA-UNAM PAPIIT grant IN-117214.

Expand Down
6 changes: 3 additions & 3 deletions src/intervals/construction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Constructors compliant with the IEEE Standard 1788-2015:
The internal constructor `unsafe_interval` is *not* compliant with the
IEEE Standard 1788-2015.
See also: [`interval`](@ref), [`±`](@ref), [`..`](@ref) and [`@I_str`](@ref).
See also: [`interval`](@ref), [`±`](@ref), [`IntervalArithmetic.Symbols.:(..)`](@ref) and [`@I_str`](@ref).
"""
struct Interval{T<:NumTypes} <: Real
lo::T
Expand Down Expand Up @@ -121,7 +121,7 @@ empty interval is returned.
rounded to the nearest when parsed (e.g. 0.1). In such cases, use the string
macro [`@I_str`](@ref) to ensure tight enclosure around the typed numbers.
See also: [`±`](@ref), [`..`](@ref) and [`@I_str`](@ref).
See also: [`±`](@ref), [`IntervalArithmetic.Symbols.:(..)`](@ref) and [`@I_str`](@ref).
# Examples
```jldoctest
Expand Down Expand Up @@ -202,7 +202,7 @@ Despite using the midpoint-radius notation, the returned interval is still an
rounded to the nearest when parsed (e.g. 0.1). In such cases, use the string
macro [`@I_str`](@ref) to ensure tight enclosure around the typed numbers.
See also: [`interval`](@ref), [`..`](@ref) and [`@I_str`](@ref).
See also: [`interval`](@ref), [`IntervalArithmetic.Symbols.:(..)`](@ref) and [`@I_str`](@ref).
# Examples
```jldoctest
Expand Down
8 changes: 4 additions & 4 deletions src/intervals/rounding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ const rounding_types = (:fast, :tight, :accurate, :slow, :none)
interval_rounding() = IntervalRounding{:tight}()

# BigFloat conversion
# convert(::Type{BigFloat}, x, rounding_mode::RoundingMode) =
# setrounding(BigFloat, rounding_mode) do
# convert(BigFloat, x)
# end
Base.convert(::Type{BigFloat}, x, rounding_mode::RoundingMode) =
setrounding(BigFloat, rounding_mode) do
convert(BigFloat, x)
end

# Parsing from string
parse(::Type{T}, x::AbstractString, rounding_mode::RoundingMode) where T = setrounding(Float64, rounding_mode) do
Expand Down

0 comments on commit d282785

Please sign in to comment.