delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2007/09/07/20:46:40

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Trace-PostClient-IP: 68.147.225.57
From: Brian Inglis <Brian DOT Inglis AT SystematicSW DOT Invalid>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: random() : What am I doing wrong?
Organization: Systematic Software
Message-ID: <ipr3e3p1op82n25c1l1374qjtaua4in0k9@4ax.com>
References: <N1GBi.41236$S91 DOT 9560 AT newsfe7-win DOT ntli DOT net> <13drciokqdoav65 AT corp DOT supernews DOT com> <200709041948 DOT l84JmRfh001331 AT envy DOT delorie DOT com> <jcsvd3d4a5i64aoc9k7gddbfj1lpefdg2d AT 4ax DOT com> <200709061337 DOT l86DbZG8002699 AT envy DOT delorie DOT com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Lines: 22
Date: Sat, 08 Sep 2007 00:40:38 GMT
NNTP-Posting-Host: 64.59.135.176
X-Complaints-To: abuse AT shaw DOT ca
X-Trace: pd7urf2no 1189212038 64.59.135.176 (Fri, 07 Sep 2007 18:40:38 MDT)
NNTP-Posting-Date: Fri, 07 Sep 2007 18:40:38 MDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Thu, 6 Sep 2007 09:37:35 -0400 in comp.os.msdos.djgpp, DJ Delorie
<dj AT delorie DOT com> wrote:

>
>> (x % 49) + 1; % => 0..49; + => 1..50
>
>Try and see :-)
>
>(x % 49) + 1
>
>x % 49 => 0..48
>+1 => 1..49

Duh! 
(x % 50) + 1; % => 0..49; + => 1..50
Bitrot in all senses!

-- 
Thanks. Take care, Brian Inglis 	Calgary, Alberta, Canada

Brian DOT Inglis AT CSi DOT com 	(Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca)
    fake address		use address above to reply

- Raw text -


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