mpn_neg (was: Re: fast inversion)

Niels Möller nisse at lysator.liu.se
Wed Apr 29 11:42:56 UTC 2015


tg at gmplib.org writes:

>   Not sure why we're doing this as an inline function in gmp.h.
>   
> Me neither.  Perhaps as it is tiny?

I think inlines in gmp.h makes sense for functions which are tiny and
O(1) in the common case, like mpn_add_1 and mpn_cmp. Or small O(1)
wrappers around O(n) functions, like mpn_add. Any other criteria?

The current mpn_neg isn't of that type, but maybe it could be if it
defers the main work to mpn_com.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.


More information about the gmp-devel mailing list