Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ New floating point number arbitraries #1040

Merged
merged 18 commits into from
Nov 20, 2020
Merged

✨ New floating point number arbitraries #1040

merged 18 commits into from
Nov 20, 2020

Conversation

dubzzz
Copy link
Owner

@dubzzz dubzzz commented Oct 6, 2020

In a nutshell

Until now fc.float was able to generate random floating numbers. Unfortunately it comes with multiple drawbacks:

  • it cannot generate all the existing floats but just a limited subset
  • its default is problematic: we ask for floats we get values in [ 0 ; 1 [
  • it can produce non 32-bit values when asked for custom ranges

This new implementation is not anymore uniform on [ 0 ; 1 [ but it can:

  • generate any 32 bits floating point numbers
  • all the existing floats have the same probability to be selected (when not biased)
  • infinity, nan and extreme values are activated by default

Related to #992

✔️ New feature
❌ Fix an issue
❌ Documentation improvement
❌ Other: tests

(✔️: yes, ❌: no)

Potential impacts

None

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 6, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 91b8b83:

Sandbox Source
Vanilla Configuration
fast-check-examples Configuration

@coveralls
Copy link

coveralls commented Oct 6, 2020

Coverage Status

Coverage increased (+0.04%) to 96.353% when pulling 91b8b83 on feat/float-next into c1d6b5a on master.

@dubzzz dubzzz changed the title 🚧 New floating point number arbitraries 🚧✨ New floating point number arbitraries Nov 15, 2020
@dubzzz dubzzz changed the title 🚧✨ New floating point number arbitraries ✨ New floating point number arbitraries Nov 20, 2020
@dubzzz dubzzz merged commit 623d351 into master Nov 20, 2020
@dubzzz dubzzz deleted the feat/float-next branch November 20, 2020 21:00
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.

None yet

2 participants