rem_vec_num

Function rem_vec_num 

Source
pub fn rem_vec_num(x: &[f64], y: f64) -> Vec<f64>
Expand description

§rem_vec_num(x, y)

Operation Function

The rem_vec_num function computes the remainders obtained after dividing each element in x by another fixed number y, and accumulates these leftovers into a new vector.

§Examples

use mathlab::math::{rem, rem_vec_num, is_nan_f64, INF_F64};
assert!(is_nan_f64(rem(0.0, 0.0)));
assert!(is_nan_f64(rem(1.0, 0.0)));
assert!(is_nan_f64(rem(INF_F64, 0.0)));
assert!(is_nan_f64(rem(INF_F64, 2.0)));
assert!(is_nan_f64(rem(INF_F64, INF_F64)));
assert!(is_nan_f64(rem(INF_F64, INF_F64)));
assert_eq!(rem_vec_num(&[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0], 3.0), [1.0, 2.0, 0.0, 1.0, 2.0, 0.0, 1.0]);

End Fun Doc