Skip to main content

R_unif_index

Function R_unif_index 

Source
pub unsafe fn R_unif_index(dn: f64) -> f64
Expand description

Generate a uniform random index in [0, dn).

Used for sampling without bias for large n.

§Important

Must call GetRNGstate() before and PutRNGstate() after. The safe form is RngGuard::unif_index. Checked wrapper for R_unif_index. Calls R_unif_index_unchecked inside with_r_thread, which panics off R’s main thread. Generated from source location line 1642, column 12. Generated from source file miniextendr-api/src/sys.rs.