[BACK]Return to urandomb.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gmp / mpz

Diff for /OpenXM_contrib/gmp/mpz/Attic/urandomb.c between version 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2000/09/09 14:13:00 version 1.1.1.2, 2003/08/25 16:06:34
Line 2 
Line 2 
    integer in the range 0 to 2^N - 1, inclusive, using STATE as the     integer in the range 0 to 2^N - 1, inclusive, using STATE as the
    random state previously initialized by a call to gmp_randinit().     random state previously initialized by a call to gmp_randinit().
   
 Copyright (C) 1999, 2000  Free Software Foundation, Inc.  Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
   
 This file is part of the GNU MP Library.  This file is part of the GNU MP Library.
   
Line 25  MA 02111-1307, USA. */
Line 25  MA 02111-1307, USA. */
 #include "gmp-impl.h"  #include "gmp-impl.h"
   
 void  void
 #if __STDC__  mpz_urandomb (mpz_ptr rop, gmp_randstate_t rstate, unsigned long int nbits)
 mpz_urandomb (mpz_t rop, gmp_randstate_t rstate, unsigned long int nbits)  
 #else  
 mpz_urandomb (rop, rstate, nbits)  
      mpz_t rop;  
      gmp_randstate_t rstate;  
      unsigned long int nbits;  
 #endif  
 {  {
   mp_ptr rp;    mp_ptr rp;
   mp_size_t size;    mp_size_t size;
   
   size = (nbits + BITS_PER_MP_LIMB - 1) / BITS_PER_MP_LIMB;    size = (nbits + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS;
   if (ALLOC (rop) < size)    if (ALLOC (rop) < size)
     _mpz_realloc (rop, size);      _mpz_realloc (rop, size);
   

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>