Function align_precision

Source
pub fn align_precision(a: f64, b: f64) -> f64
Expand description

Aligns the precision of one f64 value to match another f64 value.

ยงExamples

let a = 123.456789;
let b = 78.9;
let aligned_a = lib::utils::align_precision(a, b);
assert_eq!(aligned_a, 123.5);
let a = 2.37;
let b = 631.3;
let aligned_a = lib::utils::align_precision(a, b);
assert_eq!(aligned_a, 2.4);