~ubuntu-branches/ubuntu/intrepid/ecl/intrepid

« back to all changes in this revision

Viewing changes to src/gmp/randsd.c

  • Committer: Bazaar Package Importer
  • Author(s): Peter Van Eynde
  • Date: 2007-04-09 11:51:51 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070409115151-ql8cr0kalzx1jmla
Tags: 0.9i-20070324-2
Upload to unstable. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* gmp_randseed (state, seed) -- Set initial seed SEED in random state
2
 
   STATE.
 
1
/* gmp_randseed (state, seed) -- Set initial seed SEED in random state STATE.
3
2
 
4
 
Copyright 2000, 2004 Free Software Foundation, Inc.
 
3
Copyright 2000, 2002 Free Software Foundation, Inc.
5
4
 
6
5
This file is part of the GNU MP Library.
7
6
 
17
16
 
18
17
You should have received a copy of the GNU Lesser General Public License
19
18
along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
20
 
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
21
 
MA 02111-1307, USA. */
 
19
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
20
MA 02110-1301, USA. */
22
21
 
23
22
#include "gmp.h"
24
23
#include "gmp-impl.h"
27
26
gmp_randseed (gmp_randstate_t rstate,
28
27
              mpz_srcptr seed)
29
28
{
30
 
  mpz_fdiv_r_2exp (rstate->_mp_seed, seed,
31
 
                   rstate->_mp_algdata._mp_lc->_mp_m2exp);
32
 
 
 
29
  (*((gmp_randfnptr_t *) RNG_FNPTR (rstate))->randseed_fn) (rstate, seed);
33
30
}