tens_in_limb.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. #include <config.h>
  2. #include "../printf/gmp-impl.h"
  3. /* Definitions according to limb size used. */
  4. #if BITS_PER_MP_LIMB == 32
  5. # define MAX_DIG_PER_LIMB 9
  6. # define MAX_FAC_PER_LIMB 1000000000UL
  7. #elif BITS_PER_MP_LIMB == 64
  8. # define MAX_DIG_PER_LIMB 19
  9. # define MAX_FAC_PER_LIMB 10000000000000000000ULL
  10. #else
  11. # error "mp_limb_t size " BITS_PER_MP_LIMB "not accounted for"
  12. #endif
  13. /* Local data structure. */
  14. const mp_limb_t __quadmath_tens_in_limb[MAX_DIG_PER_LIMB + 1] attribute_hidden
  15. =
  16. { 0, 10, 100,
  17. 1000, 10000, 100000L,
  18. 1000000L, 10000000L, 100000000L,
  19. 1000000000L
  20. #if BITS_PER_MP_LIMB > 32
  21. , 10000000000ULL, 100000000000ULL,
  22. 1000000000000ULL, 10000000000000ULL, 100000000000000ULL,
  23. 1000000000000000ULL, 10000000000000000ULL, 100000000000000000ULL,
  24. 1000000000000000000ULL, 10000000000000000000ULL
  25. #endif
  26. #if BITS_PER_MP_LIMB > 64
  27. #error "Need to expand tens_in_limb table to" MAX_DIG_PER_LIMB
  28. #endif
  29. };