Trait Rand

Source
pub trait Rand {
    // Required method
    fn rand(
        seed: u64,
        int: impl IntoRandRange,
        frac: impl IntoRandRange,
    ) -> Self;
}

Required Methods§

Source

fn rand(seed: u64, int: impl IntoRandRange, frac: impl IntoRandRange) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Rand for Dec19x19

Generates a deterministic random Dec19x19 value using a seed, an integer precision, and a fractional precision. Never returns zero.

§Tests

check! ( [Dec19x19::rand] {
    (0,  6, 0) => Dec19x19!(-758_415),
    (1,  6, 0) => Dec19x19!(-717_558),
    (2,  6, 0) => Dec19x19!(-149_577),
    (3,  6, 0) => Dec19x19!(-442_649),
    (4,  6, 0) => Dec19x19!( 658_419),
    (5,  6, 0) => Dec19x19!( 165_296),

    (6,  3, 0) => Dec19x19!(-787),
    (7,  3, 0) => Dec19x19!(-354),
    (8,  3, 0) => Dec19x19!( 745),
    (9,  3, 0) => Dec19x19!( 163),
    (10, 3, 0) => Dec19x19!(-211),
    (11, 3, 0) => Dec19x19!(-719),

    (12, 3, 3) => Dec19x19!(-698.488),
    (13, 3, 3) => Dec19x19!( 354.710),
    (14, 3, 3) => Dec19x19!( 807.648),
    (15, 3, 3) => Dec19x19!(-392.145),
    (16, 3, 3) => Dec19x19!(-243.552),
    (17, 3, 3) => Dec19x19!( 378.313),

    (18, 6, 6) => Dec19x19!( 428_879.493_071),
    (19, 6, 6) => Dec19x19!( 414_719.622_665),
    (20, 6, 6) => Dec19x19!( 154_184.335_022),
    (21, 6, 6) => Dec19x19!( 335_592.781_210),
    (22, 6, 6) => Dec19x19!(-562_472.732_119),
    (23, 6, 6) => Dec19x19!(-990_435.673_210),

    (0, 0, 6) => Dec19x19!(-0.758_415),
    (1, 0, 6) => Dec19x19!(-0.617_558),
    (2, 0, 6) => Dec19x19!(-0.049_577),
    (3, 0, 6) => Dec19x19!(-0.342_649),
    (4, 0, 6) => Dec19x19!( 0.658_419),
    (5, 0, 6) => Dec19x19!( 0.065_296),

    (1, 19, 19) => Dec19x19!(-7_175_586_050_193_843_404.647_199_936_274_331_797_4),

    (0, 0, 0) => Dec19x19!(-7),
    (1, 0, 0) => Dec19x19!(-6),
    (2, 0, 0) => Dec19x19!(-1),
    (3, 0, 0) => Dec19x19!(-3),
    (4, 0, 0) => Dec19x19!(6),
    (5, 0, 0) => Dec19x19!(1),

    (1, 0..=9, 0..=9) => Dec19x19!(42545517.614973869),
    (2, 0..=9, 0..=9) => Dec19x19!(-0.41),
    (3, 0..=9, 0..=9) => Dec19x19!(-224053),
    (4, 0..=9, 0..=9) => Dec19x19!(662259.83081),
    (5, 0..=9, 0..=9) => Dec19x19!(-5.748),
});