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, 1994, 1995, 2001, 2002, 2011, 2012 Free Software 8 Foundation, 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 the GNU Lesser General Public License as published by 14 the Free Software Foundation; either version 3 of the License, or (at your 15 option) any later version. 16 17 The GNU MP Library is distributed in the hope that it will be useful, but 18 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 19 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 20 License for more details. 21 22 You should have received a copy of the GNU Lesser General Public License 23 along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ 24 25 #include "gmp.h" 26 #include "gmp-impl.h" 27 #include "longlong.h" 28 29 30 /* Same as mpz_sizeinbase, meaning exact for power-of-2 bases, and either 31 exact or 1 too big for other bases. */ 32 33 size_t 34 mpn_sizeinbase (mp_srcptr xp, mp_size_t xsize, int base) 35 { 36 size_t result; 37 MPN_SIZEINBASE (result, xp, xsize, base); 38 return result; 39 } 40