Math_Random
[ class tree: Math_Random ] [ index: Math_Random ] [ all elements ]

Class: Math_Random

Source Location: /Math/Random.php

Class Overview


Math_Random base class.


Author(s):

Copyright:

  • 2005 Ants Aasma

Methods


Child classes:

Math_Random_BlumBlumShub
Implementation of the Blum Blum Shub cryptographically strong pseudorandom number generator.
Math_Random_Stream
Random number source using an entropy file or device
Math_Random_mtrand
Object-oriented interface to the PHP Mersenne twister PRNG
Math_Random_PHPrand
Object-oriented interface to the PHP rand() function

Class Details

[line 52]
Math_Random base class.

This class defines basic interface to be implemented by child classes.




Tags:

abstract:  
license:  BSD License (3 Clause)
copyright:  2005 Ants Aasma
author:  Ants Aasma <ants.aasma@gmail.com>


[ Top ]


Class Methods


method getFloat [line 113]

float getFloat( [float $min = 0], [float $max = 1])

Return a random float

Returns a random floating point number between $min and $max.




Tags:

return:  Random float


Parameters:

float   $min   minimum value of the random number
float   $max   maximum value of the random number

[ Top ]

method getInteger [line 102]

int getInteger( int $min, int $max)

Return a random integer

Returns a random integer between $min and $max (inclusive).




Tags:

return:  Random integer
abstract:  


Overridden in child classes as:

Math_Random_BlumBlumShub::getInteger()
Return a random integer
Math_Random_Stream::getInteger()
Return a random integer
Math_Random_mtrand::getInteger()
Return a random integer
Math_Random_PHPrand::getInteger()
Return a random integer

Parameters:

int   $min   minimum value of the random number
int   $max   maximum value of the random number

[ Top ]

method getMaxInteger [line 91]

int getMaxInteger( )

Return maximum supported integer

The value returned by this function is the upper limit to the getInteger method parameters. Values above this are not supported by the used class and will most likely not work.




Tags:

return:  Minimum supported integer
abstract:  


Overridden in child classes as:

Math_Random_BlumBlumShub::getMaxInteger()
Return maximum supported integer
Math_Random_Stream::getMaxInteger()
Return maximum supported integer
Math_Random_mtrand::getMaxInteger()
Return maximum supported integer
Math_Random_PHPrand::getMaxInteger()
Return maximum supported integer

[ Top ]

method getMinInteger [line 80]

int getMinInteger( )

Return minimum supported integer

The value returned by this function is the lower limit to the getInteger method parameters. Values below this are not supported by the used class and will most likely not work.




Tags:

return:  Minimum supported integer
abstract:  


Overridden in child classes as:

Math_Random_BlumBlumShub::getMinInteger()
Return minimum supported integer
Math_Random_Stream::getMinInteger()
Return minimum supported integer
Math_Random_mtrand::getMinInteger()
Return minimum supported integer
Math_Random_PHPrand::getMinInteger()
Return minimum supported integer

[ Top ]

method getString [line 62]

string getString( int $len)

Get a string of random characters

Returns a binary string of 8bit characters with the specified length.




Tags:

return:  string of random characters


Overridden in child classes as:

Math_Random_BlumBlumShub::getString()
Get a string of random characters
Math_Random_Stream::getString()
Get a string of random characters
Math_Random_mtrand::getString()
Get a string of random characters
Math_Random_PHPrand::getString()
Get a string of random characters

Parameters:

int   $len   Length of string to return

[ Top ]


Documentation generated on Sun, 09 Oct 2005 06:53:25 +0300 by phpDocumentor 1.3.0RC3