git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] simple random data generator for tests

From
Nicolas Pitre <nico@cam.org>
Date
Apr 11, 2007, 17:52 UTC
Message-ID
<alpine.LFD.0.98.0704111348040.28181@xanadu.home>
In-Reply-To
<20070411174205.GQ5436@spearce.org>
On Wed, 11 Apr 2007, Shawn O. Pearce wrote:
Show 8 quoted lines
> Nicolas Pitre <nico@cam.org> 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!
Show 5 quoted lines
> > +	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
Previous: Shawn O. PearceNext: Nicolas Pitre
Message 3 of 4 in “simple random data generator for tests”
  1. 1/2 simple random data generator for testsNicolas Pitre, Apr 11, 2007
  2. Shawn O. PearceApr 11, 2007
  3. Nicolas PitreApr 11, 2007
  4. 1/2 simple random data generator for testsNicolas Pitre, Apr 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.