From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c7fc42d2c6a0eedc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-04 23:30:15 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.net!wanadoo.fr!not-for-mail From: Pascal Obry Newsgroups: comp.lang.ada Subject: Re: Ada2005 random Date: 05 Apr 2003 09:29:45 +0200 Organization: Home - http://perso.wanadoo.fr/pascal.obry Message-ID: References: <3e8d421a$1@epflnews.epfl.ch> <6lk1m-lm3.ln1@beastie.ix.netcom.com> NNTP-Posting-Host: avelizy-103-1-7-195.abo.wanadoo.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news-reader12.wanadoo.fr 1049527814 26579 81.48.101.195 (5 Apr 2003 07:30:14 GMT) X-Complaints-To: abuse@wanadoo.fr NNTP-Posting-Date: 5 Apr 2003 07:30:14 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.95 Xref: archiver1.google.com comp.lang.ada:35949 Date: 2003-04-05T07:30:14+00:00 List-Id: Dennis Lee Bieber 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