GAP Manual: 10.10. LogInt

LogInt( n, base )

LogInt returns the integer part of the logarithm of the positive integer n with respect to the positive integer base, i.e., the largest positive integer exp such that base^(exp) <= n. LogInt will signal an error if either n or base is not positive.

    gap> LogInt( 1030, 2 );
    10        # $2^{10} = 1024$
    gap> LogInt( 1, 10 );
    0 

[next] [prev] [up]