Skip to content

A constant RNG, for cases when you need high efficiency and don't care about randomness

License

Notifications You must be signed in to change notification settings

cscherrer/ConstantRNGs.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConstantRNGs

Stable Dev Build Status Coverage

Someimes we have code that generates random values, but we don't really care about the randomness. Maybe we just need to know the shape of the result, or we're doing smoke testing. In these cases, the result of random sampling would be fine, but we might like to have something simpler without unnecessary overhead.

For example,

julia> using Random, ConstantRNGs

julia> randn(ConstantRNG())
0.0

julia> rand(ConstantRNG())
0.5

julia> randexp(ConstantRNG())
1.0

As always, there's a relevant XKCD:

About

A constant RNG, for cases when you need high efficiency and don't care about randomness

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages