```{index} single: sizeinbase_gmp; Math::GMP function ``` ```{index} single: Math::GMP::sizeinbase_gmp; Perl function ``` # sizeinbase_gmp Return the number of digits `$x` would take in the given base. ## Synopsis ```perl Math::GMP->new(10**100)->sizeinbase_gmp(10); # 101 Math::GMP->new(255)->sizeinbase_gmp(2); # 8 ``` The count may be off by one on the high side — this is `libgmp`'s documented behaviour for `mpz_sizeinbase`, which trades accuracy for speed. Use it for buffer sizing, not for exact digit counts.