Skip to content

Conversation

@teal-bauer
Copy link

boolean() now accepts float probabilities, so you can do boolean(0.001) for a 0.1% chance instead of being limited to integer percentages.

Uses 53-bit float generation (equivalent to PHP 8.3's Randomizer::nextFloat()). Backward compatible — integer percentages still work.

Fixes #761

The previous implementation used integer comparison (1-100) which
limited probability resolution to 1%. Using float comparison with
53 bits of precision allows for sub-percentage probability values.

Fixes FakerPHP#761
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant