The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » sci.math.* » sci.math

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: RNGs: A Super KISS
Replies: 14   Last Post: Feb 26, 2013 10:53 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Dann Corbit

Posts: 1,424
Registered: 12/8/04
Re: RNGs: A Super KISS
Posted: Nov 4, 2009 4:26 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Nov 4, 9:18 am, David <> wrote:
> On an x86-64 machine using GCC version 4.3.3 (Ubuntu 4.3.3-5ubuntu4),
> both the C code and C++ code fail for me.
> I get:
>      x=505478909.
> Does x=-872412446?
> Changing the unsigned long's to unsigned int's fixed the problem.
> And it does matter: before the change, the generator failed a variety
> of tests (really odd assortment, though: parking lot, 2dsphere,
> 3dsphere, squeeze, and sums).

OK, makes sense. The RNG must assume 32 bit longs.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.