Here’s the translation of the Go code example to Racket, formatted in Markdown suitable for Hugo:
Our first example demonstrates generating random numbers in Racket. Here’s the full source code:
To run the program, save it as random-numbers.rkt and use racket:
Some of the generated numbers may be different when you run the sample.
In Racket, the math/random library provides functions for generating random numbers. The random function is versatile and can generate both integers and floating-point numbers.
When you need a known seed for reproducibility, Racket uses pseudo-random-generator objects. You can create a new generator, set its state, and use it within a parameterize block to affect the behavior of random.