468,242 Members | 1,902 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,242 developers. It's quick & easy.

64-bit Random Number Generator

Hello;
Does anyone know a 64-bit integer generator for 32-bit machines that
use long long or __int64 etc ?
Jun 27 '08 #1
4 13805
On Tue, 24 Jun 2008 04:32:42 -0700, Lexicon wrote:
Hello;
Does anyone know a 64-bit integer generator for 32-bit machines that use
long long or __int64 etc ?
You'll find a 64-bit version of the excellent (fast, very long period,
good statistical properties) Mersenne Twister generator at:

http://www.math.sci.hiroshima-u.ac.j.../MT/emt64.html

The basic word type is `unsigned long long', so if that's 64-bit on your
system it'll work; otherwise change it to whatever 64-bit (unsigned) type
your compiler supports.

It's also C code, but you can easily C++-isfy it if you want.

Cheers,

--
Lionel B
Jun 27 '08 #2
Lexicon wrote:
Hello;
Does anyone know a 64-bit integer generator for 32-bit machines that
use long long or __int64 etc ?
What's an integer generator?
Jun 27 '08 #3
On Tue, 24 Jun 2008 14:58:55 +0000, Juha Nieminen wrote:
Lexicon wrote:
>Hello;
Does anyone know a 64-bit integer generator for 32-bit machines that
use long long or __int64 etc ?

What's an integer generator?
Judging by the subject of the message, this would refer to a (pseudo-)
random number generator that generates integers (presumably uniformly)
random on a range of integers... as opposed, I guess, to a random number
generator that generates floating point numbers on a range of real
numbers.

--
Lionel B
Jun 27 '08 #4
On Jun 24, 6:09*pm, Lionel B <m...@privacy.netwrote:
On Tue, 24 Jun 2008 14:58:55 +0000, Juha Nieminen wrote:
Lexicon wrote:
Hello;
Does anyone know a 64-bit integer generator for 32-bit machines that
use long long or __int64 etc ?
* What's an integer generator?

Judging by the subject of the message, this would refer to a (pseudo-)
random number generator that generates integers (presumably uniformly)
random on a range of integers... as opposed, I guess, to a random number
generator that generates floating point numbers on a range of real
numbers.

--
Lionel B
Yeah that was what i meant.
And Lionel, thank you very much for the Mersenne twister, i just
ported it to c++ and it works great.
Jun 27 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Marc Poinot | last post: by
3 posts views Thread by Odd Bjørn Andersen | last post: by
reply views Thread by Hugo | last post: by
13 posts views Thread by Mary Lei | last post: by
10 posts views Thread by krunalb | last post: by
1 post views Thread by =?Utf-8?B?UGF1bCBQaGlsbGlwcw==?= | last post: by
2 posts views Thread by James | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.