Linspace and irrationals with Float32


#1

The following line throws an error

julia> 2π*linspace(0.0f0, 1.0f0, 2)
ERROR: MethodError: no method matching LinSpace{T<:AbstractFloat}(::Float64, ::Float64, ::Float32, ::Float32)

but this is fine

julia> 2(π*linspace(0.0f0, 1.0f0, 2))
2-element LinSpace{Float32}:
 0.0,6.28319

both on v0.5 and v0.6. There doesn’t seem to be an issue open: should I file one or is this nitpicking?


#2

Looks like a bug, though not about irrationals.

julia> 2.0 * linspace(0f0, 1f0, 2)
ERROR: MethodError: no method matching LinSpace{T<:AbstractFloat}(::Float64, ::Float64, ::Float32, ::Float32)
Closest candidates are:
  LinSpace{T<:AbstractFloat}{T<:AbstractFloat}(::T<:AbstractFloat, ::T<:AbstractFloat, ::T<:AbstractFloat, ::T<:AbstractFloat) at range.jl:213
  LinSpace{T<:AbstractFloat}{T}(::Any) at sysimg.jl:66
 in *(::Float64, ::LinSpace{Float32}) at ./abstractarraymath.jl:96

#3

You are right, I should have seen it.