-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Typo in python random.random documentation #101097
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
Comments
This isn't a typo, the opening square bracket And the closing round bracket So the random number is >= 0.0 but < 1.0. |
It is using standard interval notation. |
This has come up before. Apparently, the interval notation is not universally known and recognized. I will switch the |
There's a few more we could change, at least those in docs: $ git grep "\[[0-9.]*, [0-9.]*)"
Doc/faq/library.rst:This returns a random floating point number in the range [0, 1).
Doc/howto/functional.rst: >>> # Generate 8 random numbers between [0, 10000)
Doc/library/random.rst:generates a random float uniformly in the semi-open range [0.0, 1.0). Python
Doc/library/random.rst: Return the next random floating point number in the range [0.0, 1.0).
Include/bytearrayobject.h: * the bytes are mapped to ints in [0, 256).
Lib/random.py: # When x and y are two variables from [0, 1), uniformly
Lib/random.py: """Get the next random number in the range [0.0, 1.0)."""
Lib/test/sortperf.py: """Return a list of n random floats in [0, 1)."""
Modules/_randommodule.c:random() -> x in the interval [0, 1).
Modules/clinic/_randommodule.c.h:"random() -> x in the interval [0, 1).");
Objects/floatobject.c: /* Normalize f to be in the range [1.0, 2.0) */
Objects/floatobject.c: /* Normalize f to be in the range [1.0, 2.0) */
Objects/floatobject.c: /* Normalize f to be in the range [1.0, 2.0) */
Python/dtoa.c: * a number in the range [0.1, 1). */ |
…than signs for random.random()'s documentation (#101119)
… less than signs for random.random()'s documentation (pythonGH-101119) (cherry picked from commit 8bcd4a6) Co-authored-by: Andrew Hong <andrewhong@myyahoo.com>
Uh oh!
There was an error while loading. Please reload this page.
There is a typo in documentation here regarding random.random()
the next random floating point number in the range [0.0, 1.0).
It can be corrected by replacing ")" with "]"
Linked PRs
The text was updated successfully, but these errors were encountered: