Advertisement
Guest User

Untitled

a guest
Dec 6th, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.38 KB | None | 0 0
  1. type complex = {
  2.     x : float;
  3.     y : float;
  4.   }
  5.  
  6. let iters1 max_iter xc yc =
  7.   let rec aux count c =
  8.     if count = max_iter then max_iter else begin
  9.       if c.x *. c.x  +. c.y *. c.y >= 4.0 then count else begin
  10.         aux (count+1) { x = c.x *. c.x -. c.y *. c.y +. xc;
  11.                         y = 2.0 *. c.x *. c.y +. yc  }
  12.       end
  13.     end in
  14.   aux 0 { x=xc; y=yc }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement