Retrieve the logarithm of number in a specified base ?
Evadream
evadream.mlist at evadream.net
Sun Dec 5 16:24:59 CET 2004
RTFM ! :D
Function: int mpfr_log (mpfr_t rop, mpfr_t op, mp_rnd_t rnd)
Sorry, again.
If you've got any suggestions, or another method to retrieve what i want :)
Thanx !
Evadream wrote:
> Hello everybody,
>
> I'm discovering this fantastic library, and begin to play with it.
>
> Here is my problem, maybe there is a better way to do it, so please tell
> me if you know it :)
>
> I've got one mpz_t (an integer, for exemple i ), and i would like to find
> a to have :
>
> B^a < i < B^(a+1).
>
> My (bad ?) idea is to compute the log of i in the base B (ln(i)/ln(B)) and
> to take the integer part, but i don't see any function to deal with log in
> a specified base (only natural log, log2 and log10 using mpfr).
>
> Maybe you can help me ?
>
> Thanx !
More information about the gmp-discuss
mailing list