From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA01314 for caml-redistribution; Tue, 1 Dec 1998 19:45:09 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA27214 for ; Tue, 1 Dec 1998 11:35:50 +0100 (MET) Received: from lri.lri.fr (lri.lri.fr [129.175.15.1]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id LAA25232 for ; Tue, 1 Dec 1998 11:35:48 +0100 (MET) Received: from sun8f.lri.fr (sun8f.lri.fr [129.175.8.16]) by lri.lri.fr (8.9.1a/8.9.1) with ESMTP id LAA21151; Tue, 1 Dec 1998 11:35:49 +0100 (MET) Received: by sun8f.lri.fr (8.6.12/local) id LAA08335 ; Tue, 1 Dec 1998 11:35:41 +0100 From: Claude Marche MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <13923.50811.334235.394872@sun8f.LRI> Date: Tue, 1 Dec 1998 11:35:39 +0100 (MET) To: N Hur CC: caml-list@inria.fr Subject: Re: nth_root of num? In-Reply-To: References: <13917.32917.504083.314031@sun8f.LRI> X-Mailer: VM 6.62 under Emacs 20.2.1 Content-Transfer-Encoding: 8bit Sender: weis >>>>> "N Hur" == N Hur writes: N Hur> Thank you. N Hur> But running your code for example, N Hur> root_floor 3 (Int 2) (* menaing third_root of 2 *);; N Hur> gives 1, while what we want is 1.2599210498 ... Sorry, I misunderstood your question. I though you where interested in computing the nth root of a big_num. If you are interested in computing the nth root of a float, I really don't understand why you are using big nums. An algorithm for computing the nth root of a float is easy : let nth_root n x = exp (log(x)/.(float_of_int n));; Hope this helps. If it doesn't answer to your question, please explain your problem more precisely. - Claude -- | Claude Marché | mailto:Claude.Marche@lri.fr | | LRI - Bât. 490 | http://www.lri.fr/~marche/ | | Université de Paris-Sud | phoneto: +33 1 69 15 64 85 | | F-91405 ORSAY Cedex | faxto: +33 1 69 15 65 86 |