Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Fix: Do not pick a random float less than minimum #909

Merged
merged 1 commit into from
May 9, 2016

Conversation

localheinz
Copy link
Contributor

@localheinz localheinz commented May 8, 2016

This PR

  • fixes an issue where a value generated by randomFloat($nbMaxDecimals, $min) can actually be less than $min

@@ -110,6 +110,9 @@ public static function randomFloat($nbMaxDecimals = null, $min = 0, $max = null)

if (null === $max) {
$max = static::randomNumber();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fzaninotto

$max can be 0 here.

@fzaninotto fzaninotto merged commit 0be0f12 into fzaninotto:master May 9, 2016
@fzaninotto
Copy link
Owner

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants