Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!sdd.hp.com!hp-pcd!hpfcso!hpfcdc!rodean From: rodean@hpfcdc.HP.COM (Bruce Rodean) Newsgroups: comp.sys.hp Subject: Re: RAND_MAX in stdlib.h is wrong (HP-UX 7.0) Message-ID: <5570518@hpfcdc.HP.COM> Date: 16 Oct 90 15:47:04 GMT References: Organization: Hewlett-Packard Co., Ft. Collins, CO. Lines: 23 In article tt@euler.jyu.fi (Tapani Tarvainen) writes: > Just a quick note in case anybody should happen to use code like > > $include > ... > (double)rand()/RAND_MAX > > the definition of RAND_MAX in stdlib.h is wrong: > > # define RAND_MAX 32763 > > whereas it should be 32767. (This is in HP-UX 7.0; earlier releases > didn't have RAND_MAX defined at all, newer ones I don't know about.) It appears that this was just a typographical mistake made the first time it was created. It has already been corrected for the next revision of HP-UX to 32767 as you stated. Thanks for pointing it out. Bruce Rodean Hewlett-Packard Co. rodean@hpfcla.HP.COM This does not represent the official position of Hewlett-Packard Co.