Skip to content

Commit

Permalink
Merge 3d25a4b into 277b52f
Browse files Browse the repository at this point in the history
  • Loading branch information
stillyslalom committed May 21, 2020
2 parents 277b52f + 3d25a4b commit 935f3ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,9 @@ Base.nextfloat(a::Measurement, n::Integer) = result(nextfloat(a.val, n), 1, a)

Base.maxintfloat(::Type{Measurement{T}}) where {T<:AbstractFloat} = maxintfloat(T)

Base.floatmin(::Type{Measurement{T}}) where {T<:AbstractFloat} = floatmin(T) ± zero(T)
Base.floatmax(::Type{Measurement{T}}) where {T<:AbstractFloat} = floatmax(T) ± zero(T)

Base.typemax(::Type{Measurement{T}}) where {T<:AbstractFloat} = typemax(T)

### Rounding
Expand Down
4 changes: 3 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -533,13 +533,15 @@ end
end
end

@testset "Machine precisionx" begin
@testset "Machine precision" begin
@test eps(Measurement{Float64}) eps(Float64)
@test eps(x) eps(x.val)
@test nextfloat(x) nextfloat(x.val) ± x.err
@test nextfloat(x, 3) nextfloat(x.val, 3) ± x.err
@test prevfloat(w) prevfloat(w.val) ± w.err
@test prevfloat(y, 3) prevfloat(y.val, 3) ± y.err
@test floatmin(Measurement{Float64}) floatmin(Float64) ± zero(Float64)
@test floatmax(Measurement{Float64}) floatmax(Float64) ± zero(Float64)
@test maxintfloat(Measurement{Float64}) maxintfloat(Float64)
end

Expand Down

0 comments on commit 935f3ec

Please sign in to comment.