real roots, powers

Paul Leyland paul at
Wed Dec 28 20:55:46 CET 2005

On Wed, 2005-12-28 at 17:06, Gergely CZUCZY wrote:
> hello
> i've started using GMP for some arithmetic functions for an applications.
> i'm mostly working with integer arithmetics.
> my questions is, how can an integere number be raised to a not-integer power?
> like n^x, where n is an integer, x is a real number, like 1.2 or 0.7

Implement the exp and log functions, using mpf primitives, then use well
known identities.   Alternatively, use mpfr functions.

> also, how can i get a real root of a number? root(n,x) where x is real, n is integer
> (on real here, i mean floating-point numbers)
> ______________________________________________________________________
Newton-Raphson will do, at a pinch.


More information about the gmp-discuss mailing list