mpn_mod_1 and friend

Torbjorn Granlund tege at swox.com
Sun Jun 12 11:21:23 CEST 2005


Washuu Kobayashi <washuu at eastnews.com.pl> writes:

  what  is  the  difference  (in  terms  of usage) between mpn_mod_1 and
  mpn_modexact_1_odd?  the  manual  is very short on info about them, it
  doesn't even mention the latter function.
  
Since you read the source, perhaps you spotted this message:

   THE FUNCTIONS IN THIS FILE ARE FOR INTERNAL USE ONLY.  THEY'RE ALMOST
   CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN
   FUTURE GNU MP RELEASES.

Washuu Kobayashi <washuu at eastnews.com.pl> continues:

  If  I  understand  the source, mpn_modexact_1_odd is used when size of
  dividend  is  greater  than  MODEXACT_1_ODD_THRESHOLD,  which  (on x86
  platform)  seems  to  be  MP_SIZE_T_MAX.  So  _always_  would  be used
  mpn_mod_1, right?
  
That's not right.  With the above caution in mind, you might want
to read the 70 lines comment in the file.  That should tell you
what it does.

If you decide to use mpn_modexact_1_odd, your program will not
work with future GMP releases.

-- 
Torbjörn


More information about the gmp-discuss mailing list