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

Random numbers, floats vs ints and rand_range - need improving? #6235

Closed
Sslaxx opened this issue Aug 22, 2016 · 1 comment
Closed

Random numbers, floats vs ints and rand_range - need improving? #6235

Sslaxx opened this issue Aug 22, 2016 · 1 comment

Comments

@Sslaxx
Copy link

Sslaxx commented Aug 22, 2016

Operating system or device - Godot version:
OS is N/A, issue is valid as of at least Godot 2.1.

Issue description (what happened, and what was expected):
Per http://docs.godotengine.org/en/latest/classes/[email protected]#class-gdscript-rand-range

Note that there is no corresponding rand_range function for integers; the existing "rand_range" function returns a floating point value. This seems to me to be a bit of an oversight. Naming also is inconsistent with the existing randf/randi functions.

What would be nice is to rename the existing function to randf_rage (to cover floating point), and to provide an integer version (randi_range).

@akien-mga
Copy link
Member

This is a duplicate/subset of #7199, which is more recent but also got more recent activity, so closing in favour of that one. If some information described here is missing from the other issue, feel free to link it/copy it there.

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

No branches or pull requests

3 participants