Without implementing a random number generator, this is just no general way to create a random number. So the default implementation of this method simply calls the rand function of the standard C library. This results in a maximum of 32 bits, regardless of the value of d (in fact the default implementation completely ignores the value in d). To be in any way meaningful, this method must be specialized for the type T.
Name | Type | Description |
---|---|---|
d | size_t | The number of decimal digits in the random number. |
#include <nttl/nttlTraits.h> ... nttlTraits<int> tr; ... int x = tr.Random( 27 ); |