The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] Origins of drand48()?
@ 2010-03-31 22:20 Warren Toomey
  2010-04-01  1:23 ` John Cowan
  2010-04-01 23:39 ` Cyrille Lefevre
  0 siblings, 2 replies; 9+ messages in thread
From: Warren Toomey @ 2010-03-31 22:20 UTC (permalink / raw)


I was idly going through the 1999 Swartz memo
(http://www.groklaw.net/pdf/Swartz.pdf), wherein the source code of
RedHat 5.2 and UnixWare are compared for similarities. Most of those
are either bogus (just some #includes) or BSD-derived code. There is
one file which is concerning: drand48.c. The RedHat 5.2 file is very
similar to the UnixWare file, including headers and #ifdef's e.g.

/*      @(#)drand48.c   2.2     */
/*LINTLIBRARY*/
/*
 *      drand48, etc. pseudo-random number generator
 *      This implementation assumes unsigned short integers of at least
 *      16 bits, long integers of at least 32 bits, and ignores
 *      overflows on adding or multiplying two unsigned integers.
 *      Two's-complement representation is assumed in a few places.
 *      Some extra masking is done if unsigneds are exactly 16 bits
 *      or longs are exactly 32 bits, but so what?
 *      An assembly-language implementation would run significantly faster.
 */

#include <stdlib.h>

#ifndef HAVEFP
#define HAVEFP 1
#endif

As far as I can determine, drand48() arrived in SysVR1 and is defined
in the first SVID. It doesn't appear in SysIII, nor in the early BSDs.
Can anybody shed some light on drand48()? Could it have been written
elsewhere and made available e.g on a Usenix tape or comp.sources.*,
and included into SysV, or is SysV the origin of the code?

I'm sure the algorithm comes from elsewhere, e.g. Knuth, but the
strong code similarity is a worry.

Thanks,
	Warren
_______________________________________________
TUHS mailing list
TUHS at minnie.tuhs.org
https://minnie.tuhs.org/mailman/listinfo/tuhs



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-04-02  1:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-31 22:20 [TUHS] Origins of drand48()? Warren Toomey
2010-04-01  1:23 ` John Cowan
2010-04-01  2:01   ` Larry McVoy
2010-04-01  2:23     ` M. Warner Losh
2010-04-01  7:06     ` Michael Davidson
2010-04-01 23:39 ` Cyrille Lefevre
2010-04-02  0:17   ` John Cowan
2010-04-02  0:39     ` Larry McVoy
2010-04-02  1:10       ` Jason Stevens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).