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

Addition of randi() function #123

Closed
GhostVaibhav opened this issue Jun 27, 2024 · 2 comments · Fixed by #124
Closed

Addition of randi() function #123

GhostVaibhav opened this issue Jun 27, 2024 · 2 comments · Fixed by #124

Comments

@GhostVaibhav
Copy link
Contributor

Hi

I would like to know the feasibility of creating a new function randInt() that generates a random integer. It will take an integer value as the argument and generate a random integer between 0 < generated <= value.

@FlorianRappl
Copy link
Owner

I think we can do. My suggestion is to call it randi(n) where n is the inclusive upper boundary. We might also make n optional, with a default value of 100 (but having it required is also possible).

@GhostVaibhav
Copy link
Contributor Author

Let's pass a required value rather than an optional one. Since I think that's most probably how it's implemented in all other places.

@GhostVaibhav GhostVaibhav changed the title Addition of randInt() Addition of randi() function Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants