Skip to content

Commit

Permalink
fix typos in docs (JuliaLang#53378)
Browse files Browse the repository at this point in the history
fix typos in docs
  • Loading branch information
ben46 authored Feb 18, 2024
1 parent 2a9c95a commit 4505855
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/src/devdocs/build/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ DEPS_GIT = llvm
# LLVM_GIT_URL = ...
#Name of the alternate branch to clone from git
# LLVM_BRANCH = julia-16.0.6-0
#SHA hash of the alterate commit to check out automatically
#SHA hash of the alternate commit to check out automatically
# LLVM_SHA1 = $(LLVM_BRANCH)
#List of LLVM targets to build. It is strongly recommended to keep at least all the
#default targets listed in `deps/llvm.mk`, even if you don't necessarily need all of them.
Expand Down
4 changes: 2 additions & 2 deletions stdlib/Random/docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ There are two mostly orthogonal ways to extend `Random` functionalities:
The API for 1) is quite functional, but is relatively recent so it may still have to evolve in subsequent releases of the `Random` module.
For example, it's typically sufficient to implement one `rand` method in order to have all other usual methods work automatically.

The API for 2) is still rudimentary, and may require more work than strictly necessary from the implementor,
The API for 2) is still rudimentary, and may require more work than strictly necessary from the implementer,
in order to support usual types of generated values.

### Generating random values of custom types
Expand All @@ -103,7 +103,7 @@ Generating random values for some distributions may involve various trade-offs.

The `Random` module defines a customizable framework for obtaining random values that can address these issues. Each invocation of `rand` generates a *sampler* which can be customized with the above trade-offs in mind, by adding methods to `Sampler`, which in turn can dispatch on the random number generator, the object that characterizes the distribution, and a suggestion for the number of repetitions. Currently, for the latter, `Val{1}` (for a single sample) and `Val{Inf}` (for an arbitrary number) are used, with `Random.Repetition` an alias for both.

The object returned by `Sampler` is then used to generate the random values. When implementing the random generation interface for a value `X` that can be sampled from, the implementor should define the method
The object returned by `Sampler` is then used to generate the random values. When implementing the random generation interface for a value `X` that can be sampled from, the implementer should define the method

```julia
rand(rng, sampler)
Expand Down
4 changes: 2 additions & 2 deletions stdlib/Random/src/generation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Sampler(::Type{RNG}, ::Type{T}, n::Repetition) where {RNG<:AbstractRNG,T<:AbstractFloat} =
Sampler(RNG, CloseOpen01(T), n)

# generic random generation function which can be used by RNG implementors
# generic random generation function which can be used by RNG implementers
# it is not defined as a fallback rand method as this could create ambiguities

rand(r::AbstractRNG, ::SamplerTrivial{CloseOpen01{Float16}}) =
Expand Down Expand Up @@ -130,7 +130,7 @@ rand(r::AbstractRNG, sp::SamplerTrivial{<:UniformBits{T}}) where {T} =

#### BitInteger

# rand_generic methods are intended to help RNG implementors with common operations
# rand_generic methods are intended to help RNG implementers with common operations
# we don't call them simply `rand` as this can easily contribute to create
# ambiguities with user-side methods (forcing the user to resort to @eval)

Expand Down

0 comments on commit 4505855

Please sign in to comment.