delorie.com/archives/browse.cgi | search |
From: | bigphil AT solutions DOT mb DOT ca (Mark Phillips) |
Newsgroups: | comp.os.msdos.djgpp |
Subject: | rand() or random() |
Date: | Tue, 04 Nov 1997 07:02:49 GMT |
Organization: | MBnet - Manitoba's Connection To The Internet |
Lines: | 10 |
Message-ID: | <63mh1a$9r4$1@postern.mbnet.mb.ca> |
NNTP-Posting-Host: | 204.112.6.182 |
To: | djgpp AT delorie DOT com |
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
Just for the heck of it, say I want to get a random number from 0 to 19. rand() and random() appear to return numbers from 0 to 2^31. I could always do rand() * 20 / 2^31 but there must be a better way. right? TIA mark phillips
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |