Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type complex = {
- mutable x : float;
- mutable y : float;
- }
- let iters1 max_iter xc yc =
- let c = { x=xc; y=yc } in
- let rec aux count =
- if count = max_iter then max_iter else begin
- if c.x *. c.x +. c.y *. c.y >= 4.0 then count else begin
- let x = c.x in
- c.x <- x *. x -. c.y *. c.y +. xc;
- c.y <- 2.0 *. x *. c.y +. yc;
- aux (count+1)
- end
- end in
- aux 0
Advertisement
Add Comment
Please, Sign In to add comment