diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-10-25 10:23:26 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-10-25 10:23:26 -0400 |
commit | 98292bb163c83b9d2472e286a4e5d034cff028ce (patch) | |
tree | f6a13997da72dda3046a670a1c10466e511eebba /src | |
parent | 264fa55dcf2d72d8ddf0bb6fd96be29e4e57d666 (diff) | |
download | julia-fractals-98292bb163c83b9d2472e286a4e5d034cff028ce.tar.gz julia-fractals-98292bb163c83b9d2472e286a4e5d034cff028ce.zip |
make this parameterized
Diffstat (limited to 'src')
-rw-r--r-- | src/mandelbrot.jl | 8 |
1 files changed, 4 insertions, 4 deletions
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 |