Function malachite_base::rounding_modes::random::random_rounding_modes
source · [−]pub fn random_rounding_modes(seed: Seed) -> RandomRoundingModes
Expand description
Uniformly generates random RoundingMode
s.
The output length is infinite.
Expected complexity
Constant time and additional memory.
Examples
extern crate itertools;
use itertools::Itertools;
use malachite_base::random::EXAMPLE_SEED;
use malachite_base::rounding_modes::random::random_rounding_modes;
use malachite_base::rounding_modes::RoundingMode;
use malachite_base::rounding_modes::RoundingMode::*;
assert_eq!(
random_rounding_modes(EXAMPLE_SEED).take(10).collect_vec(),
&[Up, Exact, Ceiling, Up, Floor, Nearest, Exact, Up, Floor, Exact]
)