64-bit Random Number Generator

Discussion in 'C++' started by Lexicon, Jun 24, 2008.

  1. Lexicon

    Lexicon Guest

    Hello;
    Does anyone know a 64-bit integer generator for 32-bit machines that
    use long long or __int64 etc ?
    Lexicon, Jun 24, 2008
    #1
    1. Advertising

  2. Lexicon

    Lionel B Guest

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

    --
    Lionel B
    Lionel B, Jun 24, 2008
    #2
    1. Advertising

  3. 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?
    Juha Nieminen, Jun 24, 2008
    #3
  4. Lexicon

    Lionel B Guest

    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
    Lionel B, Jun 24, 2008
    #4
  5. Lexicon

    Lexicon Guest

    On Jun 24, 6:09 pm, Lionel B <> wrote:
    > 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.
    Lexicon, Jun 24, 2008
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kingsley Oteng

    Random Number Generator??

    Kingsley Oteng, Apr 27, 2004, in forum: VHDL
    Replies:
    11
    Views:
    52,126
    rahul.iyer
    Aug 9, 2010
  2. tshad

    Random number/letter generator

    tshad, May 5, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    9,555
    tshad
    May 6, 2005
  3. globalrev
    Replies:
    4
    Views:
    745
    Gabriel Genellina
    Apr 20, 2008
  4. Jeff.M
    Replies:
    6
    Views:
    163
    Lasse Reichstein Nielsen
    May 4, 2009
  5. VK
    Replies:
    15
    Views:
    1,125
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page