[Shootout-list] some perl test

William Douglas Neumann wdnx@unm.edu
Mon, 29 Nov 2004 08:01:27 -0700 (MST)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--411118345-1260932705-1101740203=:9610
Content-Type: TEXT/PLAIN; CHARSET=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-ID: <Pine.LNX.4.61.0411290757161.10667@deneb.unm.edu>

On Mon, 29 Nov 2004, [iso-8859-1] Michal =A9pa=E8ek wrote:

> btw: Why do you use Double precision in java takfp?

Good question.  Shouldn't you really be using ints? And shouldn't you=20
really be passing the function h(x,y,z) into the TAK function as well?

BTW: Here's the OCaml version of TAKesque:

let rec tak x y z =3D
   if y >=3D x then z
   else tak (tak (x -. 1.) y z) (tak (y -. 1.) z x) (tak (z -. 1.) x y);;

let _ =3D
   let n =3D float_of_string Sys.argv.(1) in
     print_float (tak (3. *. n) (2. *. n) n);
     print_newline ();;

William D. Neumann
<wdnx@unm.edu>

--- Dear Lord, please make me the kind of person=20
my dog thinks I am.

--411118345-1260932705-1101740203=:9610--