comp.lang.ada
 help / color / mirror / Atom feed
From: Pascal Obry <p.obry@wanadoo.fr>
Subject: Re: Ada2005 random
Date: 05 Apr 2003 09:29:45 +0200
Date: 2003-04-05T07:30:14+00:00	[thread overview]
Message-ID: <uadf5s8pi.fsf@wanadoo.fr> (raw)
In-Reply-To: 6lk1m-lm3.ln1@beastie.ix.netcom.com


Dennis Lee Bieber <wlfraed@ix.netcom.com> writes:

>         Might do for the short run, but I can see a failure in the long
>         run...
> 
>         For simplicity, say "Integer" covers 0..8, and the selection run 0..7 
> (necessitating use of a mod 8)... The result will be that selection 0 
> will have 2/9 chances with 1..7 having 1/9, rather than all having a 
> 1/8 chance.

Ok, but integer has a range of -(2 ** 31) .. +(2 ** 31 - 1) so the difference
could be something around +/- (x / (2 ** 31 - 1)) !

Not so bad for a simple program I would say.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|         http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



  parent reply	other threads:[~2003-04-05  7:29 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-03 12:27 Ada2005 random David C. Hoos, Sr.
2003-04-03 12:39 ` Peter Hermann
2003-04-03 22:10   ` Randy Brukardt
2003-04-04  7:43     ` Peter Hermann
2003-04-04 10:21     ` Dale Stanbrough
2003-04-04 12:11       ` Stuart Palin
2003-04-04 14:25       ` Lutz Donnerhacke
2003-04-04 21:51         ` Dale Stanbrough
2003-04-05 18:34           ` Samuel Tardieu
2003-04-05  6:46       ` Martin Krischik
2003-04-07 21:07         ` Randy Brukardt
2003-04-13 14:56       ` Robert I. Eachus
2003-04-13 21:58         ` Mark Biggar
2003-04-04 12:20     ` Stuart Palin
2003-04-07  7:26       ` Jean-Etienne Doucet
2003-04-07  8:09         ` Lutz Donnerhacke
2003-04-04  8:27   ` 
2003-04-04 12:14     ` Peter Hermann
2003-04-04 14:26       ` Lutz Donnerhacke
     [not found]     ` <6lk1m-lm3.ln1@beastie.ix.netcom.com>
2003-04-05  7:29       ` Pascal Obry [this message]
2003-04-05  9:00         ` tmoran
2003-04-05 17:02           ` Pascal Obry
  -- strict thread matches above, loose matches on Subject: below --
2003-04-02 13:27 Peter Hermann
2003-04-02 13:44 ` Lutz Donnerhacke
2003-04-03  9:56   ` Peter Hermann
2003-04-03 10:13     ` Lutz Donnerhacke
2003-04-04  3:50 ` Steve
2003-04-04 14:30   ` Lutz Donnerhacke
2003-04-05  3:02     ` Steve
2003-04-04  4:33 ` Christoph Grein
2003-04-06 15:44   ` 
2003-04-05  0:14 ` Jeffrey Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox