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

big: add random number generation #1164

Closed
FlorianUekermann opened this issue Oct 5, 2010 · 3 comments
Closed

big: add random number generation #1164

FlorianUekermann opened this issue Oct 5, 2010 · 3 comments

Comments

@FlorianUekermann
Copy link
Contributor

A random number generator returning equally distributed big.Int values between 0 and n
(like rands Intn(int) method) would be nice and usefull.

Implementing them outside the big Package would be possible but since the relevant
fields of big.Int are private, there is no really elegant and efficient way to do this
as far as I can see.

And since these are very basic operations which may often be usefull when dealing with
"big" numbers it would be a good idea to have them provided by the standard
library anyway imho.

If you like this idea but don't have time to implement it yourself, just give me some
hints how you would like it to be structured, since I need to do it anyway.
@adg
Copy link
Contributor

adg commented Oct 6, 2010

Comment 1:

Labels changed: added featurerequest, priority-low, removed priority-medium.

Status changed to HelpWanted.

@rsc
Copy link
Contributor

rsc commented Oct 6, 2010

Comment 2:

The way to implement this is to wrap nat.random,
already in the big package and used by probablyPrime.

@rsc
Copy link
Contributor

rsc commented Oct 19, 2010

Comment 4:

changeset:   6551:721e204b1c38
user:        Florian Uekermann <florian@uekermann-online.de>
date:        Mon Oct 18 14:09:20 2010 -0400
summary:     big: add random number generation

Status changed to Fixed.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants