-
-
Notifications
You must be signed in to change notification settings - Fork 943
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
number.float is unable to return 1/max exactly #2361
Comments
It seems to be the usual behaviour for a random number generator generating values between 0 (included) and 1 (not included). For instance, |
Then the problem is all our other methods such as faker.number.int that do generate the max value? |
Yeah, I came to the same conclusion as @dubzzz I didn't head an eye on that until now, because I was always just interested in some fake data and not scientific correct accurate numbers. Just like give me any value between |
Ints are fine to have inclusive max. But floats intuitively don't. |
What about our faker.number.float() method with precision? |
Team Decision: Works as expected |
Pre-Checks
Describe the bug
faker.number.float() is unable to return 1.
Minimal reproduction code
Additional Context
Originally part of:
Environment Info
Which module system do you use?
Used Package Manager
pnpm
The text was updated successfully, but these errors were encountered: