X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Trace-PostClient-IP: 68.147.225.57 From: Brian Inglis Newsgroups: comp.os.msdos.djgpp Subject: Re: random() : What am I doing wrong? Organization: Systematic Software Message-ID: References: <13drciokqdoav65 AT corp DOT supernews DOT com> <200709041948 DOT l84JmRfh001331 AT envy DOT delorie 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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 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