Wraparound multiplicaton vs mullo

Niels Möller nisse at lysator.liu.se
Sat Oct 17 22:38:15 CEST 2009

Torbjorn Granlund <tg at gmplib.org> writes:

>   /* mul_2nm1.c
>    *
>    * Experimental code for multiplication mod 2^n-1.
>    */
> Should this be B^n-1?

Naming is generally poor. Nut it *is* mod 2^n - 1, for certain values of n.

> Do you represent 0 canonically as B^n-1?

No, it's only "seminormalized", no canonical representation of zero.
I'd expect that B^n - 1 is more likely than zero, since various terms
are added together and then extra high limbs are wrapped around and
added in at the low end. 

> You might want to add a LGPL 3 header to the code, without any header it
> defaults to "all rights reserved".

I'm adding a "this file" LGPL3 header. See next mail.


More information about the gmp-devel mailing list