Squaring Question

Paul Zimmermann Paul.Zimmermann at loria.fr
Thu Feb 19 21:41:22 CET 2009


> If I need to square a value many times in a loop, is using mpz_mul the
> fastest way in GMP to achieve this or is there another function that
> is better specifically for squaring?

mpz_mul (t, r, r) is the best way: it automagically recognizes it is a
squaring, and calls the corresponding squaring function.

Paul Zimmermann


More information about the gmp-discuss mailing list