MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / prod

Function prod

std/math/src/main/float.rs:269–274  ·  view source on GitHub ↗
(it: Handle, kw: Kwargs)

Source from the content-addressed store, hash-verified

267// `prod(iterable, *, start=1.0)`. Returns a float; integer inputs lose their int-ness.
268#[plugin_fn]
269fn prod(it: Handle, kw: Kwargs) -> Result<f64> {
270 let mut acc = kw.get::<f64>("start")?.unwrap_or(1.0);
271 let iter = it.iter()?;
272 while let Some(h) = iter.iter_next()? { acc *= f64::from_handle(h.raw())?; }
273 Ok(acc)
274}

Callers

nothing calls this directly

Calls 3

iter_nextMethod · 0.80
iterMethod · 0.45
rawMethod · 0.45

Tested by

no test coverage detected