JuliaMath / JuliaMath/IntervalSets.jl

Convert `eltype` using specific types

Open
#137 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
109
Forks
29
PR merge metrics
No merged PRs in 30d

Description

The conversion to `float` works, so ideally, conversions to specific element types should work as well:
```julia
julia> float(0..1)
0.0..1.0

julia> Float64(0..1)
ERROR: MethodError: no method matching Float64(::IntervalSets.ClosedInterval{Int64})

Closest candidates are:
(::Type{T})(::AbstractChar) where T<:Union{AbstractChar, Number}
@ Base char.jl:50
(::Type{T})(::Base.TwicePrecision) where T<:Number
@ Base twiceprecision.jl:266
(::Type{T})(::Complex) where T<:Real
@ Base complex.jl:44
...

Stacktrace:
[1] top-level scope
@ REPL[67]:1
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.