diff --git a/base/dft.jl b/base/dft.jl index 700bbc68c2dec..f1072d2ae99e6 100644 --- a/base/dft.jl +++ b/base/dft.jl @@ -24,6 +24,7 @@ typealias FFTWFloat Union{Float32,Float64} fftwfloat(x) = _fftwfloat(float(x)) _fftwfloat{T<:FFTWFloat}(::Type{T}) = T _fftwfloat(::Type{Float16}) = Float32 +_fftwfloat{T}(::Type{Complex{T}}) = Complex{_fftwfloat(T)} _fftwfloat{T}(::Type{T}) = error("type $T not supported") _fftwfloat{T}(x::T) = _fftwfloat(T)(x) diff --git a/test/fft.jl b/test/fft.jl index b30e05ff09a5a..376d7e5e32248 100644 --- a/test/fft.jl +++ b/test/fft.jl @@ -6,6 +6,8 @@ a = rand(8) + im*rand(8) @test norm(ifft(fft(a,1),1) - a) < 1e-8 @test norm(ifft(fft(a,[1]),[1]) - a) < 1e-8 @test norm(ifft(fft(a,(1,)),(1,)) - a) < 1e-8 +a = rand(-10:10, 8) + im*rand(-10:10, 8) +@test norm(ifft(fft(a)) - a) < 1e-8 m4 = [16. 2 3 13; 5 11 10 8;