TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Mike Kerna
from: Kurt Kuzba
date: 1998-07-18 10:34:28
subject: Random number generat

MK>   The rand() function will only generate to 5 or 6 decimal
MK>   places I believe; whereas, the above formula will
MK>   generate to 10.  Which means that it will do a better job
MK>   of generating large numbers.
   rand() returns an integer value, not a floating point.
   The QB and QBasic RND function returns floating point.
/* maximum value that can be returned by the rand function. */
#define RAND_MAX 0x7fff
   The above is from a STDLIB.H file for a C compiler.
   As you can see, rand() returns a value from 0 to 32767 in
   this particular implementation. Here is another:
#define RAND_MAX    32767
   And another:
#define RAND_MAX    32767
   These are all 16-bit compilers, of course, but my VC++5.0
   also gives a maximum value of 0x7fff.

> ] I am Spam of Borg... Ooh! That's redundant, isn't it!??.....

---
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)
SEEN-BY: 396/1 622/419 632/371 633/260 267 270 371 634/397 635/506 728
SEEN-BY: 639/252 670/213 218
@PATH: 154/750 222 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.