From 98292bb163c83b9d2472e286a4e5d034cff028ce Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 25 Oct 2014 10:23:26 -0400 Subject: make this parameterized --- src/mandelbrot.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mandelbrot.jl b/src/mandelbrot.jl index bde0a74..9cddee7 100644 --- a/src/mandelbrot.jl +++ b/src/mandelbrot.jl @@ -1,6 +1,6 @@ -type Mandelbrot - c::Array{Complex{Float64}, 2} - z::Array{Complex{Float64}, 2} +type Mandelbrot{T <: FloatingPoint} + c::Array{Complex{T}, 2} + z::Array{Complex{T}, 2} Mandelbrot(imgsize) = ( line = linspace(-2.0, 2.0, imgsize); @@ -9,6 +9,6 @@ type Mandelbrot ) end -function step(m::Mandelbrot) +function step{T <: FloatingPoint}(m::Mandelbrot{T}) m.z = m.z.^2 + m.c end -- cgit v1.2.3-54-g00ecf