From: Claude Marche <Claude.Marche@lri.fr>
Date: Tue, 1 Dec 1998 11:35:39 +0100 (MET)
To: N Hur <mapnh@maths.bath.ac.uk>
Subject: Re: nth_root of num?
In-Reply-To: <Pine.SOL.4.05.9812011025090.6015-100000@odin.maths.bath.ac.uk>
<Pine.SOL.4.05.9812011025090.6015-100000@odin.maths.bath.ac.uk>
>>>>> "N Hur" == N Hur <mapnh@maths.bath.ac.uk> 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 |
This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:17 MET