unexpected MPZ_OVERFLOW

Vincent Lefevre vincent at vinc17.net
Thu Aug 13 17:34:44 CEST 2026


On 2026-08-13 14:49:25 +0200, Marco Bodrato wrote:
> To change this, we should change the definition of the type
> mp_bitcnt_t. It can be done, but it would be an incompatible change.

Alternatively, instead of mp_bitcnt_t, you could internally use a
new type name that would correspond to mp_limb_t. Since this would
be for internal use only, this would not be an incompatible change.

However, for the few functions that return a result of type
mp_bitcnt_t, you would need to decide what to do when the
conversion of the new internal type to mp_bitcnt_t changes
the value (because the original value is too large for the
mp_bitcnt_t type), for instance by generating an overflow.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)


More information about the gmp-bugs mailing list