1

I have noticed that cpp_int backend of Boost.Multiprecion library uses 32-bit unsigned integer as a word (limb) on 64-bit architecture. The requirement for 64-bit word to be used is availability of native 128-bit integer in compiler (that might be a clue). Why is that?

More about the "clue". limb_type is defined as detail::largest_unsigned_type<32>::type for compilers without native 128-bit integer support in file boost/multiprecision/cpp_int/cpp_int_config.hpp. There is also a type called double_limb_type.

Paweł Bylica
  • 3,780
  • 1
  • 31
  • 44
  • Where did you get that "clue"? That's a good starting point for people who might now some more background reading that – sehe Oct 09 '14 at 10:00
  • It's possibly because, to do operations on the unit words and get overflow, you need to have a larger type available. I.e. multiplying two 32 words gives you a 64 bit result. – davmac Oct 09 '14 at 14:04

0 Answers0