Util.Random*

This commit is contained in:
Maxim Khomutov 2023-07-21 18:37:42 +03:00
parent ac5f5ee894
commit 3d9e08d05d

View File

@ -247,15 +247,17 @@ class Util:
def JsonDiffApply(self, base, diff): def JsonDiffApply(self, base, diff):
self.log.debug("requesting JsonDiffApply()") self.log.debug("requesting JsonDiffApply()")
def Random(self) -> int: def Random(self) -> float:
self.log.debug("requesting Random()") self.log.debug("requesting Random()")
return random.randint(0, 1) return random.random()
def RandomIntRange(self, min_v, max_v): def RandomIntRange(self, min_v, max_v) -> int:
self.log.debug("requesting RandomIntRange()") self.log.debug("requesting RandomIntRange()")
return random.randint(min_v, max_v)
def RandomRange(self, min_v, max_v): def RandomRange(self, min_v, max_v) -> float:
self.log.debug("requesting RandomRange()") self.log.debug("requesting RandomRange()")
return random.uniform(min_v, max_v)
# noinspection PyPep8Naming # noinspection PyPep8Naming