Path: chuka.playstation.co.uk!news From: "Jon Prestidge" Newsgroups: scee.yaroze.freetalk.english Subject: Re: rand () Date: Sat, 13 Mar 2004 15:10:53 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 18 Message-ID: References: <01c408e2$176d80e0$8500a8c0@portable-pal> NNTP-Posting-Host: host213-122-152-53.in-addr.btopenworld.com X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 > Note that % is costly, in case you want to do it a lot. ... yes if you're an integer maths junkie (and you considered every CPU cycle was sacred) you'd probably never have even considered a number range like -10 +10 you would have gone for -8 +7 or -16 +15 so that you could do a bit operation like: random = ( rand() & 31 ) - 16; // for -16 +15 range. .. but who cares :-) ( OK.....I used to care....but I've managed to cure myself of the addiction now.) Jon