nttlTraits Method - Random

Description
Return a random number of approximately d decimal digits.

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.

Signature
template<class T> T nttlTraits::Random( size_t d )
Parameters
Name Type Description
d size_t The number of decimal digits in the random number.
Returns
( T )  A random number of approximately d decimal digits.
Example
#include <nttl/nttlTraits.h>
...
nttlTraits<int> tr;
...
int x = tr.Random( 27 );