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

add simpler example to randn function #52250

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

julia> julia> randn()
lmiq marked this conversation as resolved.
Show resolved Hide resolved
-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:

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

julia> rng = Xoshiro(123);

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