64-bit Random Number Generator

L

Lexicon

Hello;
Does anyone know a 64-bit integer generator for 32-bit machines that
use long long or __int64 etc ?
 
L

Lionel B

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.jp/~m-mat/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,
 
J

Juha Nieminen

Lexicon said:
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?
 
L

Lionel B

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.
 
L

Lexicon

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.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top