pub fn round<R: Float>(x: R) -> RExpand description
Primal round.
The corresponding forward and reverse rules use a zero-gradient policy at every point, including integer inputs.
ยงExamples
use chainrules::round;
assert_eq!(round(1.4_f64), 1.0);
assert_eq!(round(1.5_f64), 2.0);