Back to index

glibc  2.9
tens_in_limb.c
Go to the documentation of this file.
00001 #include <gmp.h>
00002 
00003 
00004 /* Definitions according to limb size used.  */
00005 #if    BITS_PER_MP_LIMB == 32
00006 # define MAX_DIG_PER_LIMB   9
00007 # define MAX_FAC_PER_LIMB   1000000000UL
00008 #elif  BITS_PER_MP_LIMB == 64
00009 # define MAX_DIG_PER_LIMB   19
00010 # define MAX_FAC_PER_LIMB   10000000000000000000ULL
00011 #else
00012 # error "mp_limb_t size " BITS_PER_MP_LIMB "not accounted for"
00013 #endif
00014 
00015 
00016 /* Local data structure.  */
00017 const mp_limb_t _tens_in_limb[MAX_DIG_PER_LIMB + 1] =
00018 {    0,                   10,                   100,
00019      1000,                10000,                100000L,
00020      1000000L,            10000000L,            100000000L,
00021      1000000000L
00022 #if BITS_PER_MP_LIMB > 32
00023                ,       10000000000ULL,       100000000000ULL,
00024      1000000000000ULL,    10000000000000ULL,    100000000000000ULL,
00025      1000000000000000ULL, 10000000000000000ULL, 100000000000000000ULL,
00026      1000000000000000000ULL, 10000000000000000000ULL
00027 #endif
00028 #if BITS_PER_MP_LIMB > 64
00029   #error "Need to expand tens_in_limb table to" MAX_DIG_PER_LIMB
00030 #endif
00031 };