### Re: [racket-users] Generate really large random numbers in Racket

Thank you. I think `random-natural` works for my case. 'Paulo Matos' via Racket Users 于2019年4月2日周二 上午12:49写道： > Check the math library by Neil Toronto: > > https://docs.racket-lang.org/math/base.html?q=random#%28part._.Random_.Number_.Generation%29 > > (random-natural k) → Natural > >

### Re: [racket-users] Generate really large random numbers in Racket

If you are implementing random number generators, you may want to use a test suite: Tu01 http://simul.iro.umontreal.ca/testu01/tu01.html or Dieharder https://webhome.phy.duke.edu/~rgb/General/rand_rate/rand_rate.abs Hope this helps, Evelyn Mitchell efmph...@gmail.com On Tue, Apr 2, 2019 at 12:55

### Re: [racket-users] Generate really large random numbers in Racket

On 01/04/2019 23:37, Robby Findler wrote: > Generate multiples of those and combine them (shifting old ones over > and adding new ones as the lowest digits)? > > I'm not sure of a good way to generate nats uniformly at random where > you don't specify an upper bound, but Neil Toronto suggested

### Re: [racket-users] Generate really large random numbers in Racket

Check the math library by Neil Toronto: https://docs.racket-lang.org/math/base.html?q=random#%28part._.Random_.Number_.Generation%29 (random-natural k) → Natural k : Integer Returns a random natural number less than k, which must be positive. Use (random-natural k) instead of

### Re: [racket-users] Generate really large random numbers in Racket

Hi, I am writing SSH in pure typed racket, Generating a big random primes is one of the tasks and I just finished it. https://github.com/wargrey/lambda-shell/blob/master/ssh/digitama/algorithm/random.rkt https://github.com/wargrey/lambda-shell/blob/master/ssh/digitama/algorithm/rsa.rkt Before I

### Re: [racket-users] Generate really large random numbers in Racket

You can use `crypto-random-bytes` to generate large random numbers, however, that function returns a string of bytes, which you have to combine into an integer: (define (random-bignum bits)

### Re: [racket-users] Generate really large random numbers in Racket

Thank you for your reply. This is my thought too but I'm not sure if combining multiple random bits break any good properties of random number generators. Sorry I should've mentioned it. I was talking about bounded random numbers. Robby Findler 于2019年4月1日周一 下午3:35写道： > Generate multiples of

### Re: [racket-users] Generate really large random numbers in Racket

Generate multiples of those and combine them (shifting old ones over and adding new ones as the lowest digits)? I'm not sure of a good way to generate nats uniformly at random where you don't specify an upper bound, but Neil Toronto suggested something crazy we used this paper:

### [racket-users] Generate really large random numbers in Racket

Hello everyone, It appears that the largest number returned by the random function in Racket is 4294967087-1 for a good reason. Are there any libraries or simple approaches to generate a number larger than that? Thanks, Shaobo -- You received this message because you are subscribed to the