\CryptoManana\Core\Interfaces\RandomnessFloatOutputInterface

Interface FloatOutputInterface - Interface for random floating number generation.

Summary

Methods
Constants
getProbability()
getFloat()
getPercent()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getProbability()

getProbability(null|integer  $precision = 10) : float

Generate a probability format float number between 0.0 and 1.0.

Note: Passing null will use the global system precision value.

Parameters

null|integer $precision

Rounding precision (default => 10).

Returns

float —

Randomly generated probability value.

getFloat()

getFloat(null|float|integer  $from = 0.0, null|float|integer  $to = null, null|integer  $precision = 8) : float

Generate a random float number in a certain range.

Note: Passing null will use the default parameter value or for precision the global system value.

Parameters

null|float|integer $from

The lowest value to be returned (default => 0.0).

null|float|integer $to

The highest value to be returned (default => (float)$this->getMaxNumber()).

null|integer $precision

Rounding precision (default => 8).

Returns

float —

Randomly generated float value.

getPercent()

getPercent(null|integer  $precision = 2, boolean|integer  $lowerTheScope = false) : float

Generate a percentage format float number between 0.0 and 100.0.

Note: Passing null will use the global system precision value.

Parameters

null|integer $precision

Rounding precision (default => 2).

boolean|integer $lowerTheScope

Flag for using a smaller calculation range.

Returns

float —

Randomly generated percentage value.