www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/25/10:08:21

Date: Tue, 25 Feb 1997 16:52:51 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Cesar Scarpini Rabak <csrabak AT dce03 DOT ipt DOT br>
cc: fighteer AT cs DOT com, djgpp AT delorie DOT com
Subject: Re: Error??
In-Reply-To: <1.5.4.16.19970225095618.296ffd00@dmeasc.rc.ipt.br>
Message-ID: <Pine.SUN.3.91.970225165156.7750C-100000@is>
MIME-Version: 1.0

On Tue, 25 Feb 1997, Cesar Scarpini Rabak wrote:

> >roll = random() % 6 + 1 + random() % 6 + 1 + random() % 6 + 1;
> >
> 
> BTW^2, it is also a poor practice to use just the modulo operator in the
> return values from random, as the lower bits of the pseudo random number
> have less "randomness".

That is correct for `rand', but `random' is documented to return all of 
its bits random.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019