|
|
64-bit Random Number Generator
Hello;
Does anyone know any 64-bit number generators that work on 32-bit
machines by using long long or __int64 ?
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
0
|
|
|
|
Reply
|
Lexicon
|
6/25/2008 1:01:10 AM |
|
Lexicon schreef:
> Hello;
> Does anyone know any 64-bit number generators that work on 32-bit
> machines by using long long or __int64 ?
>
OT ?
sci.crypt.random-numbers
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
0
|
|
|
|
Reply
|
edwin
|
6/25/2008 4:56:47 PM
|
|
On Jun 25, 3:01 am, Lexicon <lex.do...@gmail.com> wrote:
> Does anyone know any 64-bit number generators that work on 32-bit
> machines by using long long or __int64 ?
I use boost::ecuyer1988.
http://www.boost.org/doc/libs/1_35_0/libs/random/random-generators.html#ecuyer1988
Does anyone know why it didn't become part of TR1?
- Marsh
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
0
|
|
|
|
Reply
|
Marsh
|
6/25/2008 4:59:08 PM
|
|
{ Top-posting is strongly discouraged in this group, please don't.
So is quoting the clc++m banner, please please don't. -mod }
I haven't heard of such random generator, but you could easily create
one by wrapping any 32-bit RNG and roling it twice each time you need
to generate a 64-bit value.
[code]
//rand32 could be any 32-bit random generator
unsigned long rand32();
unsigned long long rand64()
{
return ( static_cast<unsigned long long>( rand32() ) << 32 ) |
rand32();
}
[/code]
Regards,
Martin
Lexicon wrote:
> Hello;
> Does anyone know any 64-bit number generators that work on 32-bit
> machines by using long long or __int64 ?
>
> --
> [ See http://www.gotw.ca/resources/clcm.htm for info about ]
> [ comp.lang.c++.moderated. First time posters: Do this! ]
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
0
|
|
|
|
Reply
|
martinb
|
6/25/2008 5:02:13 PM
|
|
{ Top-posting is strongly discouraged in this group, please don't.
So is quoting the clc++m banner, please please don't. -mod }
Sorry about the hasty post I just made. See
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt64.html
On Jun 25, 11:01 am, Lexicon <lex.do...@gmail.com> wrote:
> Hello;
> Does anyone know any 64-bit number generators that work on 32-bit
> machines by using long long or __int64 ?
>
> --
> [ Seehttp://www.gotw.ca/resources/clcm.htmfor info about ]
> [ comp.lang.c++.moderated. First time posters: Do this! ]
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
0
|
|
|
|
Reply
|
martinb
|
6/25/2008 5:02:35 PM
|
|
{ Top-posting is strongly discouraged in this group. Please don't. See other
articles for examples of how to quote properly. TIA., -mod }
Perhaps something like this:
unsigned int seed = 0xA5A5A5A5;
boost::mt19937 rng(static_cast<boost::mt19937::result_type>(seed));
boost::uniform_int<long long> dist(std::numeric_limits<long
long>::min(),
std::numeric_limits<long
long>::max());
boost::variate_generator<boost::mt19937&,boost::uniform_int<long long>
> rnd(rng,dist);
long long random_value = rnd();
Arash Partow
__________________________________________________
Be one who knows what they don't know,
Instead of being one who knows not what they don't know,
Thinking they know everything about all things.
http://www.partow.net
On Jun 25, 6:01 pm, Lexicon <lex.do...@gmail.com> wrote:
> Hello;
> Does anyone know any 64-bit number generators that work on 32-bit
> machines by using long long or __int64 ?
>
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
0
|
|
|
|
Reply
|
partow
|
6/29/2008 1:10:56 PM
|
|
If linear congruential scheme meets the requirements of your task, you
can look at http://nuclear.llnl.gov/CNP/rng/rngman/node4.html
However, it is not suitable for some tasks like cryptography, etc.
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
0
|
|
|
|
Reply
|
vladimir
|
7/3/2008 8:02:49 AM
|
|
|
6 Replies
548 Views
(page loaded in 0.116 seconds)
Similiar Articles: 64-bit Random Number Generator - comp.lang.c++.moderated ...On Jun 25, 3:01 am, Lexicon <lex.do...@gmail.com> wrote: > Does anyone know any 64-bit number generators that work on 32-bit > machines by using long long or __int64 ? How to set the seed as a 128 binary string of psudo random number ...64-bit Random Number Generator - comp.lang.c++.moderated ... Re: Universal 64-bit random number generator Re: How to set the seed as a 128 binary string of psudo random ... random number generator from t location scale distribution - comp ...What, you're saying a div and a mod (let's assume 64 bits, if integet) to > find the desired bit ... random number generator from t location scale distribution - comp ... How to generate proper seeds for the rand function in Monte Carlo ...64-bit Random Number Generator - comp.lang.c++.moderated ... How to generate proper seeds for the rand function in Monte Carlo ..... for 'state' or 'twister' and only ... Pseudorandom Noise Generator.... - comp.lang.vhdl64-bit Random Number Generator - comp.lang.c++.moderated ... Random map generation - comp.graphics.api.opengl First I suggest you to read a bit on the topic of "pseudo ... Suitable Integer Square Root Algorithm for 32-64-Bit Integers on ...I'm implementing a pseudo-random number generator using a microcontroller C compiler, and ... Suitable Integer Square Root Algorithm for 32-64-Bit Integers on ... to give ... generate random values between min max values - comp.soft-sys ...64-bit Random Number Generator - comp.lang.c++.moderated ..... value. [code] //rand32 could be any 32-bit random generator ... min(), std::numeric_limits<long long>::max ... Unsigned Integer Overflow on Multiplication and Division - comp ...64-bit Random Number Generator - comp.lang.c++.moderated ... Unsigned Integer Overflow on Multiplication and Division - comp ... I'm implementing a pseudo-random number ... Random number in Fortran 90/95 - comp.lang.fortran64-bit Random Number Generator - comp.lang.c++.moderated ... SuperKISS for 32- and 64-bit RNGs in both C and Fortran. - comp ... And if we want 64-bit random numbers, with ... 64 bit integer - comp.lang.c++.moderated64-bit Random Number Generator - comp.lang.c++.moderated ... 64-bit Random Number Generator - C / C++ 64-bit Random Number Generator. C / C++ Forums on Bytes. ... 64-bit Random Number Generator - C / C++ - Bytes - Tech Commmunity ...64-bit Random Number Generator. C / C++ Forums on Bytes. ... Hello; Does anyone know a 64-bit integer generator for 32-bit machines that Random Number Generators - LLNL Nuclear Home Pagewherein the random number state fits in a 64-bit unsigned word. The multiplier, a, the addend, b, and the modulus, m, are chosen to provide a variety of high quality ... 7/22/2012 4:06:52 PM
|
|
|
|
|
|
|
|
|