🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.transputer
Article #789

Random numbers

#789
From: cca04 P.J. Mitchell
Date: Mon, 23 Jul 1990 13:11
18 lines
1330 bytes
I am using Meiko's mf77 and it doesn't come with a library of C-like
functions such as chdir, chown, mkdir etc. Therefore I have been
writing a small library of fortran wrappers for these routines to
ease calling them from fortran.

My problem is that C has the two routines srand and rand. The latter
returning an integer in the range 0-32767 (0 -> (2^15)-1). If I am
to maintain compatibility with other unix fortrans then I have to
make rand, drand and irand which are 31, 31 and 63 bits respectively.
How do I generate this accuracy from the 15 bit C rand routine that
the Sequent man pages say is used ?

Any help netters ?
--
--Paul Mitchell (CMA N.Cheshire, DoD#0145)      | Computer Centre,
JANET:  cca04@uk.ac.keele.seq1                  | University of Keele, Keele,
USENET: cca04@seq1.keele.ac.uk@nss.cs.ucl.ac.uk | Staffordshire, ST5 5BG, U.K.
BITNET: cca04%seq1.keele.ac.uk@ukacrl           | 0782 - 621111 ext 3302
Technical Details
Message-ID: <483@keele.keele.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!ukc!keele!cca04

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!ukc!keele!cca04
From: cca04@.uk.ac.keele (P.J. Mitchell)
Newsgroups: comp.sys.transputer,comp.lang.fortran
Subject: Random numbers
Message-ID: <483@keele.keele.ac.uk>
Date: 23 Jul 90 13:11:19 GMT
Sender: news@seq1.keele.ac.uk
Organization: University of Keele, Keele, STAFFS. ST5 5BG
Lines: 18