diff options
-rw-r--r-- | examples/mandelbrot.jl | 2 | ||||
-rw-r--r-- | src/mandelbrot.jl | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/mandelbrot.jl b/examples/mandelbrot.jl index ab618d4..a9cfcae 100644 --- a/examples/mandelbrot.jl +++ b/examples/mandelbrot.jl @@ -8,7 +8,7 @@ iterations = 45 imgsize = 500 img = [ Color.HSV(0, 0, 0) for x=1:imgsize, y=1:imgsize ] -m = Fractal.Mandelbrot(imgsize) +m = Fractal.Mandelbrot{Float64}(imgsize) imgc, imgslice = view(img) 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 |