Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun mandelbrot2 (c n z)
- (declare (optimize (speed 3) (safety 0) (debug 0)))
- (declare (type (and fixnum unsigned-byte) n))
- (declare (type (complex single-float) c z))
- (if (= n 0) z
- (mandelbrot2 c (the fixnum (- n 1))
- (the (complex single-float) (+ (* z z) c)))))
- (defun mandelbrot (c n z)
- (if (= n 0) z
- (mandelbrot c (- n 1) (+ (* z z) c))))
- (defun main ()
- (let* ((n (parse-integer (cadr *posix-argv*)))
- (debug (caddr *posix-argv*))
- (z0 #C(0.0 0.0))
- (c #C(0.04 0.01))
- (z (mandelbrot2 c n z0)))
- (when (string= debug "debug")
- (format t "z: ~a~%" z))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement