Skip to main content

count

Function count 

Source
pub fn count<F>(out: &mut Vec<F>, start: i64, down: bool, n: usize)
where F: Float,
Expand description

Appends the n whole numbers start, start + 1, start + 2 and so on to out as floats of type F, or start, start - 1 and so on where down is true. Each is the whole number rounded once to F. A float narrower than f64 counts in i32 where every item fits one, because every target converts i32 to it in vector form. Otherwise a target with NATIVE_64 converts each item from an integer, as float does. Wasm and x86-64 without AVX-512 have no vector instruction for that, so there each block of 8 items adds 0 to 7 steps to the block’s first item, which comes from the block’s position.