pip_services3_commons.random.RandomFloat module

pip_services3_commons.random.RandomFloat

RandomFloat implementation

copyright

Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details.

license

MIT, see LICENSE for more details.

class pip_services3_commons.random.RandomFloat.RandomFloat

Bases: object

Random generator for float values.

Example:

value1 = RandomFloat.next_float(5, 10)     # Possible result: 7.3
value2 = RandomFloat.next_float(10)        # Possible result: 3.7
value3 = RandomFloat.update_float(10, 3)   # Possible result: 9.2
static next_float(min: float, max: float = None)float
static update_float(value: float, range: float = None)float

Updates (drifts) a float args within specified range defined

Parameters
  • value – a float args to drift.

  • range – (optional) a range. Default: 10% of the args

Returns

updated random float args.