64-bit Random Number Generator

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lexicon

    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 ?
  • Lionel B

    #2
    Re: 64-bit Random Number Generator

    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:



    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

    Comment

    • Juha Nieminen

      #3
      Re: 64-bit Random Number Generator

      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?

      Comment

      • Lionel B

        #4
        Re: 64-bit Random Number Generator

        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

        Comment

        • Lexicon

          #5
          Re: 64-bit Random Number Generator

          On Jun 24, 6:09 pm, Lionel B <m...@privacy.n etwrote:
          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.

          Comment

          Working...