Ok, the following works for 0.3 and 0.4: FloatArray = Union(Array{Float32, 1}, Array{Float64, 1})
Is this the best way to define an array of floating point numbers? Am Dienstag, 18. August 2015 11:22:50 UTC+2 schrieb Uwe Fechner: > > Ok, the following definition works on Julia 0.4, but not with 0.3: > > FloatArray = Union{Array{Float32, 1}, Array{Float64, 1}} > > function sum(x::FloatArray). > > Any idea? > > Am Dienstag, 18. August 2015 11:07:16 UTC+2 schrieb Uwe Fechner: >> >> Hello, >> >> I want to write a function, that can operate on any one dimensional array >> of floating point numbers. >> >> The following works, but only for Float64: >> >> function sum(x::Array{Float64,1}) >> >> The following does not work: >> >> function sum(x::Array{AbstractFloat,1}) >> >> Any idea? >> >> Uwe >> >