home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!gdt!aber!hrs
- From: hrs@aber.ac.uk (Herbert Martin Sauro)
- Newsgroups: comp.sys.atari.st,comp.sys.atari.tech
- Subject: Bug in Lattice 5.5 rand() function (Not in 5.0)
- Message-ID: <1992Sep4.194915.10758@aber.ac.uk>
- Date: 4 Sep 92 19:49:15 GMT
- Organization: University of Wales, Aberystwyth
- Lines: 19
-
- I think I have spotted a bug in the random number generator (rand())
- of Lattice 5.5 which is not present in their earlier version 5.0.
- rand() in 5.0 returns a long value with the range 0 to 2^31. RAND_MAX
- is also 2^31. BUT in 5.5 rand() returns a long with the range 0 to 2^16
- but RAND_MAX is still 2^31. Obviously this is wrong unless of course
- I'm doing something wrong. I did check though the rand.o objects
- from both 5.0 and 5.5 using omd (dissassembler) and found that
- the 5.5 version was doing a 'clr.w d0; swap d0' before returning to
- the caller which would explain why the top 16 bits are zero.
- The rand() version from 5.0 doesn't do this. Anybody had any experience
- of this? As a temp measure I've whipped out rand() from 5.0 and am
- using it with 5.5. Hisoft are you reading this?
-
- Herb
- --
- /******************************************************************************
- Herbert Sauro e-mail: hrs@aber.ac.uk
- Biological Sciences phone: +44 970 622353
- Univesity College of Wales
-