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

simpler example for randn #52252

Merged
merged 11 commits into from
Nov 25, 2023
17 changes: 16 additions & 1 deletion stdlib/Random/src/normal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,23 @@ from the circularly symmetric complex normal distribution of variance 1 (corresp
See also [`randn!`](@ref) to act in-place.

# Examples

1. Generating a single random number, by default of type `Float64`:

```julia-repl
julia> using Random
stevengj marked this conversation as resolved.
Show resolved Hide resolved

julia> randn()
-0.942481877315864
```

2. Setting up of the random number generator with a user-defined seed, and the
generation of a random number with a `ComplexF32` type:
lmiq marked this conversation as resolved.
Show resolved Hide resolved

```jldoctest
julia> using Random; rng = Xoshiro(123);
julia> using Random

julia> rng = Xoshiro(123);

julia> randn(rng, ComplexF64)
-0.45660053706486897 - 1.0346749725929225im
Expand Down