Skip to content

Commit

Permalink
add rng argument to octorand function
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrodium committed Jan 24, 2023
1 parent ae650c6 commit ba18e61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/octonion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function Base.sqrt(o::Octonion)
exp(0.5 * log(o))
end

octorand() = octo(randn(), randn(), randn(), randn(), randn(), randn(), randn(), randn())
octorand(rng::AbstractRNG = Random.GLOBAL_RNG) = octo(randn(rng), randn(rng), randn(rng), randn(rng), randn(rng), randn(rng), randn(rng), randn(rng))

function Base.rand(rng::AbstractRNG, ::Random.SamplerType{Octonion{T}}) where {T<:Real}
Octonion{T}(rand(rng, T), rand(rng, T), rand(rng, T), rand(rng, T),
Expand Down

0 comments on commit ba18e61

Please sign in to comment.