From: Nicolas Pitre Date: Wed, 11 Apr 2007 17:52:33 GMT Subject: Re: [PATCH 1/2] simple random data generator for tests Message-ID: In-Reply-To: <20070411174205.GQ5436@spearce.org> On Wed, 11 Apr 2007, Shawn O. Pearce wrote: > Nicolas Pitre wrote: > > --- > > Makefile | 7 +++++-- > > test-genrandom.c | 34 ++++++++++++++++++++++++++++++++++ > > 2 files changed, 39 insertions(+), 2 deletions(-) > > create mode 100644 test-genrandom.c > > A change to .gitignore would also be nice. ;-) Gah! > > + unsigned long count, next = 0; > > What about wraparound? Could this produce different results on a > 32 bit system and a 64 bit system, due to the difference in size > of unsigned long? No, because the bits we extract are below 32 bits, and the multiply operation will always provide the same results in the low 32 bits regardless. Nicolas