github.com/aergoio/aergo@v1.3.1/libtool/src/gmp-6.1.2/mpn/generic/sizeinbase.c (about)

     1  /* mpn_sizeinbase -- approximation to chars required for an mpn.
     2  
     3     THE FUNCTIONS IN THIS FILE ARE FOR INTERNAL USE ONLY.  THEY'RE ALMOST
     4     CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN
     5     FUTURE GNU MP RELEASES.
     6  
     7  Copyright 1991, 1993-1995, 2001, 2002, 2011, 2012 Free Software Foundation,
     8  Inc.
     9  
    10  This file is part of the GNU MP Library.
    11  
    12  The GNU MP Library is free software; you can redistribute it and/or modify
    13  it under the terms of either:
    14  
    15    * the GNU Lesser General Public License as published by the Free
    16      Software Foundation; either version 3 of the License, or (at your
    17      option) any later version.
    18  
    19  or
    20  
    21    * the GNU General Public License as published by the Free Software
    22      Foundation; either version 2 of the License, or (at your option) any
    23      later version.
    24  
    25  or both in parallel, as here.
    26  
    27  The GNU MP Library is distributed in the hope that it will be useful, but
    28  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    29  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    30  for more details.
    31  
    32  You should have received copies of the GNU General Public License and the
    33  GNU Lesser General Public License along with the GNU MP Library.  If not,
    34  see https://www.gnu.org/licenses/.  */
    35  
    36  #include "gmp.h"
    37  #include "gmp-impl.h"
    38  #include "longlong.h"
    39  
    40  
    41  /* Same as mpz_sizeinbase, meaning exact for power-of-2 bases, and either
    42     exact or 1 too big for other bases.  */
    43  
    44  size_t
    45  mpn_sizeinbase (mp_srcptr xp, mp_size_t xsize, int base)
    46  {
    47    size_t  result;
    48    MPN_SIZEINBASE (result, xp, xsize, base);
    49    return result;
    50  }