Skip to main content

sum_precise

Function sum_precise 

Source
pub fn sum_precise<I>(values: &I) -> Result<f64, JsValue>
where I: Iterable + ErasableGenericBorrow<JsValue>,
Expand description

The Math.sumPrecise() function takes an iterable of numbers and returns their sum, computed as if with infinite precision and rounded once at the end, so it is more accurate than a naive running sum.

MDN documentation