Skip to content

Convert eltype using specific types #137

Open
@jishnub

Description

@jishnub

The conversion to float works, so ideally, conversions to specific element types should work as well:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions