in reply to Re: Randomizing Large Integers
in thread Randomizing Large Integers
Is 32K a limitation of the standard rand function?
The macro (uconfig.h, line 3368 in 5.8.8 or 4057 in 5.10.0) looks like only 15 bits are being used:
#define Drand01() ((rand() & 0x7FFF) / (double) ((unsigned long)1 << +15)) ^^^^
Update: though, a somewhat closer look suggests this might be configuration dependent (at least, Configure checks for drand48()), so maybe I spoke too soon...
Update2: just ran a test build on a system which has drand48()... et voila, the macro ends up being defined as
#define Drand01() drand48()
So, as often, the answer is: it depends :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Randomizing Large Integers
by mscharrer (Hermit) on May 19, 2008 at 20:29 UTC | |
by BrowserUk (Patriarch) on May 19, 2008 at 21:25 UTC | |
by ikegami (Patriarch) on May 20, 2008 at 16:59 UTC |