+2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
+
+ * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
+
2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
* doprnt.c (doprnt): Support "ll" length modifier, for long long.
{
EMACS_INT val;
Lisp_Object lispy_val;
- unsigned long denominator;
+ EMACS_UINT denominator;
if (EQ (limit, Qt))
seed_random (getpid () + time (NULL));
it's possible to get a quotient larger than n; discarding
these values eliminates the bias that would otherwise appear
when using a large n. */
- denominator = ((unsigned long)1 << VALBITS) / XFASTINT (limit);
+ denominator = ((EMACS_UINT) 1 << VALBITS) / XFASTINT (limit);
do
val = get_random () / denominator;
while (val >= XFASTINT (limit));